From eb2de0c09d794650494cdca09b5613fbf374fb86 Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Sat, 18 Jun 2005 15:07:28 +0000 Subject: [PATCH] c-decl.c (locate_old_decl): Add format attribute. * c-decl.c (locate_old_decl): Add format attribute. (implicit_decl_warning): Likewise. cp: * call.c (convert_like_real): Add format attribute. * typeck.c (check_for_casting_away_constness, build_static_cast_1): Likewise. * typeck2.c (readonly_error, cxx_incomplete_type_diagnostic): Likewise. From-SVN: r101158 --- gcc/ChangeLog | 3 +++ gcc/c-decl.c | 4 ++-- gcc/cp/ChangeLog | 8 ++++++++ gcc/cp/call.c | 2 +- gcc/cp/typeck.c | 4 ++-- gcc/cp/typeck2.c | 6 +++--- 6 files changed, 19 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0e948b7ff99..8aab0c70591 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2005-06-18 Kaveh R. Ghazi + * c-decl.c (locate_old_decl): Add format attribute. + (implicit_decl_warning): Likewise. + * diagnostic.h (verbatim): Move ... * toplev.h (verbatim): ... here. Add ATTRIBUTE_GCC_DIAG. * pretty-print.h (pp_verbatim): Add ATTRIBUTE_GCC_PPDIAG. diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 27d03eb8c3b..8f50b17d1ed 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1126,7 +1126,7 @@ validate_proto_after_old_defn (tree newdecl, tree newtype, tree oldtype) first in a pair of mismatched declarations, using the diagnostic function DIAG. */ static void -locate_old_decl (tree decl, void (*diag)(const char *, ...)) +locate_old_decl (tree decl, void (*diag)(const char *, ...) ATTRIBUTE_GCC_CDIAG(1,2)) { if (TREE_CODE (decl) == FUNCTION_DECL && DECL_BUILT_IN (decl)) ; @@ -2283,7 +2283,7 @@ pushdecl_top_level (tree x) static void implicit_decl_warning (tree id, tree olddecl) { - void (*diag) (const char *, ...); + void (*diag) (const char *, ...) ATTRIBUTE_GCC_CDIAG(1,2); switch (mesg_implicit_function_declaration) { case 0: return; diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3f795aa41f3..7fbbef0b2ce 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2005-06-18 Kaveh R. Ghazi + + * call.c (convert_like_real): Add format attribute. + * typeck.c (check_for_casting_away_constness, + build_static_cast_1): Likewise. + * typeck2.c (readonly_error, cxx_incomplete_type_diagnostic): + Likewise. + 2005-06-17 Geoffrey Keating PR c++/17413 diff --git a/gcc/cp/call.c b/gcc/cp/call.c index d245171a915..d3daadb8c36 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -4122,7 +4122,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, bool c_cast_p) { tree totype = convs->type; - void (*diagnostic_fn)(const char *, ...); + void (*diagnostic_fn)(const char *, ...) ATTRIBUTE_GCC_CXXDIAG(1,2); if (convs->bad_p && convs->kind != ck_user diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 58ba0798aae..ca455271a48 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -4467,7 +4467,7 @@ build_compound_expr (tree lhs, tree rhs) static void check_for_casting_away_constness (tree src_type, tree dest_type, - void (*diag_fn)(const char *, ...), + void (*diag_fn)(const char *, ...) ATTRIBUTE_GCC_CXXDIAG(1,2), const char *description) { if (diag_fn && casts_away_constness (src_type, dest_type)) @@ -4521,7 +4521,7 @@ build_static_cast_1 (tree type, tree expr, bool c_cast_p, tree intype; tree result; tree orig; - void (*diag_fn)(const char*, ...); + void (*diag_fn)(const char*, ...) ATTRIBUTE_GCC_CXXDIAG(1,2); const char *desc; /* Assume the cast is valid. */ diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index 50940645944..f5cbfe5ab19 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -74,7 +74,7 @@ void readonly_error (tree arg, const char* string, int soft) { const char *fmt; - void (*fn) (const char *, ...); + void (*fn) (const char *, ...) ATTRIBUTE_GCC_CXXDIAG(1,2); if (soft) fn = pedwarn; @@ -347,8 +347,8 @@ void cxx_incomplete_type_diagnostic (tree value, tree type, int diag_type) { int decl = 0; - void (*p_msg) (const char *, ...); - void (*p_msg_at) (const char *, ...); + void (*p_msg) (const char *, ...) ATTRIBUTE_GCC_CXXDIAG(1,2); + void (*p_msg_at) (const char *, ...) ATTRIBUTE_GCC_CXXDIAG(1,2); if (diag_type == 1) { -- 2.30.2