GNOME Bugzilla – Bug 720081
GTlsConnection: avoid non-literal format strings
Last modified: 2013-12-19 02:44:40 UTC
More FreeBSD/clang fallout. Note: I tested changing one of the "%s" in the error messages to "%d" and indeed, this is now caught and treated as an error (showing that this approach is better in any case).
Created attachment 263773 [details] [review] GTlsConnection: avoid non-literal format strings The error handling in GTlsConnection involved translated format strings that were then passed to another function where the arguments were applied. This prevents the C compiler from enforcing restrictions on the format string and runs afoul of -Werror=format-nonliteral, breaking the build under clang. Fix it up so that the error handling function takes the format string along with the argument and calls g_error_new_valist(). This allows the compiler to check that we're getting it right.
Comment on attachment 263773 [details] [review] GTlsConnection: avoid non-literal format strings ok, except: >-static int >+G_GNUC_PRINTF(5, 6) static int same comment as in the other bug >+ } while ((ret = end_gnutls_io (gnutls, direction, ret, err, errmsg, gnutls_strerror(ret))) == GNUTLS_E_AGAIN); space between "gnutls_strerror" and "("
Attachment 263773 [details] pushed as e9145a4 - GTlsConnection: avoid non-literal format strings
This makes xcode5 / macosx 10.9 happy, thanks.