gnucash maint: Bug 746517 - gnc-sql-backend.c compile fails with -Werror=format-nonliteral
John Ralls
jralls at code.gnucash.org
Fri Mar 20 22:33:44 EDT 2015
Updated via https://github.com/Gnucash/gnucash/commit/caf5a82d (commit)
from https://github.com/Gnucash/gnucash/commit/3f905e73 (commit)
commit caf5a82dbcccb1659654de182d37a3aecbfa946f
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Mar 21 10:37:18 2015 +0900
Bug 746517 - gnc-sql-backend.c compile fails with -Werror=format-nonliteral
Use GCC pragma to disable the warning in the one place that trips it.
diff --git a/src/backend/sql/gnc-backend-sql.c b/src/backend/sql/gnc-backend-sql.c
index 1638390..dc819db 100644
--- a/src/backend/sql/gnc-backend-sql.c
+++ b/src/backend/sql/gnc-backend-sql.c
@@ -1855,6 +1855,10 @@ typedef void (*TimespecSetterFunc)( const gpointer, Timespec );
#define TIMESPEC_STR_FORMAT "%04d%02d%02d%02d%02d%02d"
#define TIMESPEC_COL_SIZE (4+2+2+2+2+2)
+/* This is required because we're passing be->timespace_format to
+ * g_strdup_printf.
+ */
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
gchar*
gnc_sql_convert_timespec_to_string( const GncSqlBackend* be, Timespec ts )
{
@@ -1873,6 +1877,7 @@ gnc_sql_convert_timespec_to_string( const GncSqlBackend* be, Timespec ts )
gnc_tm_free (tm);
return datebuf;
}
+#pragma GCC diagnostic warning "-Wformat-nonliteral"
static void
load_timespec( const GncSqlBackend* be, GncSqlRow* row,
Summary of changes:
src/backend/sql/gnc-backend-sql.c | 5 +++++
1 file changed, 5 insertions(+)
More information about the gnucash-changes
mailing list