GNOME Bugzilla – Bug 746517
gnc-sql-backend.c compile fails with -Werror=format-nonliteral
Last modified: 2018-06-29 23:39:44 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.
Build completes without error using patch Pull request: https://github.com/Gnucash/gnucash/pull/28
I prefered a GCC pragma to fix this as it keeps the changes local to the problem.
Tighter solution -- thanks for the quick turn!
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.