From 77b64a49e24dd4b5f4c7edb5d4030fe8aa1eec44 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 26 Feb 2015 18:29:12 +0000 Subject: Add ATTRIBUTE_PRINTF attributes, and fix fallout Fixes building gdb on x86_64-apple-darwin14 with clang, which produces a number of warnings from -Wformat-nonliteral. Ref: https://sourceware.org/ml/gdb/2015-02/msg00047.html gdb/ChangeLog: 2015-02-26 Pedro Alves * auto-load.h (file_is_auto_load_safe): Add ATTRIBUTE_PRINTF. * complaints.c (vcomplaint): Pass argument FMT directly to printf-like functions instead of complaint->fmt. * ctf.c (ctf_save_write_metadata): Add ATTRIBUTE_PRINTF. * darwin-nat.c (inferior_debug): Add ATTRIBUTE_PRINTF. * compile/compile-loc2c.c (pushf, unary, binary): Add ATTRIBUTE_PRINTF. (do_compile_dwarf_expr_to_c): Pass string literal as format string to pushf. (BINARY): Pass string literal as format string to 'binary'. * compile/compile-object-load.c (link_callbacks_einfo): Add ATTRIBUTE_PRINTF. * guile/guile-internal.h (gdbscm_printf): Add ATTRIBUTE_PRINTF. --- gdb/guile/guile-internal.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gdb/guile/guile-internal.h') diff --git a/gdb/guile/guile-internal.h b/gdb/guile/guile-internal.h index 9a8ef68..fe306b4 100644 --- a/gdb/guile/guile-internal.h +++ b/gdb/guile/guile-internal.h @@ -146,7 +146,8 @@ extern void gdbscm_define_functions (const scheme_function *, int public); extern void gdbscm_define_integer_constants (const scheme_integer_constant *, int public); -extern void gdbscm_printf (SCM port, const char *format, ...); +extern void gdbscm_printf (SCM port, const char *format, ...) + ATTRIBUTE_PRINTF (2, 3); extern void gdbscm_debug_display (SCM obj); @@ -484,7 +485,8 @@ extern char *gdbscm_scm_to_c_string (SCM string); extern SCM gdbscm_scm_from_c_string (const char *string); -extern SCM gdbscm_scm_from_printf (const char *format, ...); +extern SCM gdbscm_scm_from_printf (const char *format, ...) + ATTRIBUTE_PRINTF (1, 2); extern char *gdbscm_scm_to_string (SCM string, size_t *lenp, const char *charset, -- cgit v1.1