GNOME Bugzilla – Bug 539947
OpenSolaris: __FUNCTION__ not defined in sun cc
Last modified: 2018-06-29 22:06:05 UTC
I'm build gnucash trunk (r17246) with sun cc under Solaris, but get following fails : /ws/onnv-tools-prc/SUNWspro/SS12/bin/cc -DHAVE_CONFIG_H -I. -I../../.. -DG_LOG_DOMAIN=\"qof\" -D_REENTRANT -D_PTHREADS -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I../../../lib/libc -xO4 -g -c gnc-date.c -KPIC -DPIC -o .libs/gnc-date.o "gnc-date.c", line 330: warning: argument mismatch "gnc-date.c", line 330: undefined symbol: __FUNCTION__ "gnc-date.c", line 330: warning: improper pointer/integer combination: arg #1 "gnc-date.c", line 821: warning: argument #1 is incompatible with prototype: prototype: pointer to char : "gnc-date.h", line 359 argument : pointer to unsigned char "gnc-date.c", line 1095: undefined symbol: __FUNCTION__ "gnc-date.c", line 1095: warning: improper pointer/integer combination: arg #1 "gnc-date.c", line 1117: warning: argument mismatch "gnc-date.c", line 1117: undefined symbol: __FUNCTION__ "gnc-date.c", line 1117: warning: improper pointer/integer combination: arg #1 "gnc-date.c", line 1141: undefined symbol: __FUNCTION__ "gnc-date.c", line 1141: warning: improper pointer/integer combination: arg #1 cc: acomp failed for gnc-date.c
Created attachment 113329 [details] [review] patch for bug #539947 Use G_GNUC_PRETTY_FUNCTION instead of __FUNCTION__ will fix this build error. If it is okay, can I commit?
Created attachment 113333 [details] [review] patch for bug #539947 Offer a new patch with more files: trunk/lib/libqof/qof/qoflog.h trunk/src/engine/kvp-scm.c trunk/src/engine/engine-helpers.c trunk/src/app-utils/gnc-exp-parser.c trunk/src/app-utils/gnc-helpers.c trunk/src/app-utils/option-util.c trunk/src/gnome-utils/dialog-options.c trunk/src/report/report-system/gnc-report.c trunk/src/report/report-gnome/dialog-column-view.c trunk/src/report/report-gnome/gnc-plugin-page-report.c trunk/src/gnome/gnc-plugin-page-register.c trunk/src/business/business-core/gncBusGuile.c trunk/src/business/business-utils/business-options.c trunk/src/business/business-gnome/business-options-gnome.c trunk/src/business/business-gnome/dialog-invoice.c
__FUNCTION__ is wrapped by G_GNUC_FUNCTION, not G_GNUC_PRETTY_FUNCTION. However, usage of these macros is not recommended by glib, and indeed glib only supplies these macros with valid data if GNUC < 3 which is definitely not good. So no, this patch isn't good. Sorry. Fix your compiler?
Refer to bug #539947, is it acceptable to G_STRFUNC instead? I test on Solaris, suncc and gcc goes okay with this macro.
Sorry, I mean bug #524344.
Yes, G_STRFUNC would be acceptable.
Created attachment 113415 [details] [review] new patch for bug #539947 with using G_STRFUNC Use G_STRFUNC replace __FUNCTION__.
Applied to trunk as r17585. Awaiting backport to branches/2.2 to avoid FTBFS. Thanks a lot!
Close this bug cause patch is committed.
Halton, please do not close bugs. This bug should not have been closed because this patch has NOT made it into a 2.2 release.
Sure, sorry for miss information in comment #8.
2.2-branch, r17733
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=539947. Please update any external references or bookmarks.