diff options
author | Elliot Lee <sopwith@src.gnome.org> | 1998-03-12 18:28:49 +0000 |
---|---|---|
committer | Elliot Lee <sopwith@src.gnome.org> | 1998-03-12 18:28:49 +0000 |
commit | aebd3d2df2c138dac0a93b3fc52cc7396b8056d0 (patch) | |
tree | afc7f13f13361992beb8998d2d7c5c4939ab3d23 /glib | |
parent | affaf4f9d265522c71f1a9ba4b359094c00dc18a (diff) | |
download | gtk+-aebd3d2df2c138dac0a93b3fc52cc7396b8056d0.tar.gz |
Make gcc give printf format warnings for g_string_sprintf() and other
Make gcc give printf format warnings for g_string_sprintf() and other
vararg printf functions.
Diffstat (limited to 'glib')
-rw-r--r-- | glib/glib.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/glib/glib.h b/glib/glib.h index 765d3a2a38..5100c8f065 100644 --- a/glib/glib.h +++ b/glib/glib.h @@ -661,8 +661,11 @@ gdouble g_strtod (const gchar *nptr, gchar **endptr); gchar* g_strerror (gint errnum); gchar* g_strsignal (gint signum); gint g_strcasecmp (const gchar *s1, const gchar *s2); +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) +gint g_snprintf (gchar *str, gulong n, gchar const *fmt, ...) __attribute__ ((format (printf, 3, 4))); +#else gint g_snprintf (gchar *str, gulong n, gchar const *fmt, ...); - +#endif /* We make the assumption that if memmove isn't available, then * bcopy will do the job. This isn't safe everywhere. (bcopy can't @@ -724,12 +727,23 @@ GString* g_string_insert_c (GString *fstring, GString* g_string_erase (GString *fstring, gint pos, gint len); +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) +void g_string_sprintf (GString *string, + gchar *fmt, + ...) __attribute__ ((format (printf, 2, 3))); + +void g_string_sprintfa (GString *string, + gchar *fmt, + ...) __attribute__ ((format (printf, 2, 3))); +#else void g_string_sprintf (GString *string, gchar *fmt, ...); + void g_string_sprintfa (GString *string, gchar *fmt, ...); +#endif /* Resizable arrays */ |