After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 746517 - gnc-sql-backend.c compile fails with -Werror=format-nonliteral
gnc-sql-backend.c compile fails with -Werror=format-nonliteral
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Build system
git-master
Other Mac OS
: Normal blocker
: ---
Assigned To: gnucash-core-maint
gnucash-core-maint
Depends on:
Blocks:
 
 
Reported: 2015-03-20 10:17 UTC by Jeff Kletsky
Modified: 2018-06-29 23:39 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jeff Kletsky 2015-03-20 10:17:42 UTC
Compiling under clang on MacOS X 10.10 (Yosemite) results in the following error:

gnc-backend-sql.c:1895:32: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
    datebuf = g_strdup_printf( be->timespec_format,

Examination of the code indicates that, in fact, this is *not* a string literal
although it is generally set to a #DEFINE of a string literal.

As this appears to be intentional behavior to allow for the format string to be set for the specific backing database's needs, perhaps the simplest approach is to modify the Makefile to only raise a warning in this specific directory for this specific case.

Manual edit of the generated Makefile confirms that this will allow GnuCash to complete the build and run. Checking a clean build with changes to the specific Makefile.am at this time.
Comment 1 Jeff Kletsky 2015-03-20 14:12:07 UTC
Build completes without error using patch

Pull request:
https://github.com/Gnucash/gnucash/pull/28
Comment 2 John Ralls 2015-03-21 02:34:22 UTC
I prefered a GCC pragma to fix this as it keeps the changes local to the problem.
Comment 3 Jeff Kletsky 2015-03-21 09:32:21 UTC
Tighter solution -- thanks for the quick turn!
Comment 4 John Ralls 2018-06-29 23:39:44 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=746517. Please update any external references or bookmarks.