c-decl.c (locate_old_decl): Add format attribute.
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Sat, 18 Jun 2005 15:07:28 +0000 (15:07 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Sat, 18 Jun 2005 15:07:28 +0000 (15:07 +0000)
* 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
gcc/c-decl.c
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/typeck.c
gcc/cp/typeck2.c

index 0e948b7ff997ca0f0fb4240f18841bcc44185291..8aab0c70591689922c63e4a3f9e2d61e7cee4dcf 100644 (file)
@@ -1,5 +1,8 @@
 2005-06-18  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
+       * 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.
index 27d03eb8c3b06820df1ad1999cd716a7bc62cd4e..8f50b17d1eddaa4bd1aeeba6e78fd84157ef1711 100644 (file)
@@ -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;
index 3f795aa41f39d54cce5209a8a483f7bd55ee983f..7fbbef0b2ceff8f976dc79fe3805760445ea6eb8 100644 (file)
@@ -1,3 +1,11 @@
+2005-06-18  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * 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  <geoffk@apple.com>
 
        PR c++/17413
index d245171a91557173216912ce0a8134dfcd7132e2..d3daadb8c363f890f8382aa58a208f7777d089c6 100644 (file)
@@ -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
index 58ba0798aaeeeab8e4c080c31a2e1b8b71d86990..ca455271a48d0de018611e61a610fd40c897b775 100644 (file)
@@ -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.  */
index 50940645944db81e4ae7d34adbec9e1ad45f34aa..f5cbfe5ab19e5bc28cb5c76d43bcbc7088bbe322 100644 (file)
@@ -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)
     {