Commit eb2de0c0 by Kaveh R. Ghazi Committed by Kaveh Ghazi

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
parent 2c8b1096
2005-06-18 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 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 ... * diagnostic.h (verbatim): Move ...
* toplev.h (verbatim): ... here. Add ATTRIBUTE_GCC_DIAG. * toplev.h (verbatim): ... here. Add ATTRIBUTE_GCC_DIAG.
* pretty-print.h (pp_verbatim): Add ATTRIBUTE_GCC_PPDIAG. * pretty-print.h (pp_verbatim): Add ATTRIBUTE_GCC_PPDIAG.
......
...@@ -1126,7 +1126,7 @@ validate_proto_after_old_defn (tree newdecl, tree newtype, tree oldtype) ...@@ -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 first in a pair of mismatched declarations, using the diagnostic
function DIAG. */ function DIAG. */
static void 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)) if (TREE_CODE (decl) == FUNCTION_DECL && DECL_BUILT_IN (decl))
; ;
...@@ -2283,7 +2283,7 @@ pushdecl_top_level (tree x) ...@@ -2283,7 +2283,7 @@ pushdecl_top_level (tree x)
static void static void
implicit_decl_warning (tree id, tree olddecl) 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) switch (mesg_implicit_function_declaration)
{ {
case 0: return; case 0: return;
......
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> 2005-06-17 Geoffrey Keating <geoffk@apple.com>
PR c++/17413 PR c++/17413
......
...@@ -4122,7 +4122,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, ...@@ -4122,7 +4122,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
bool c_cast_p) bool c_cast_p)
{ {
tree totype = convs->type; tree totype = convs->type;
void (*diagnostic_fn)(const char *, ...); void (*diagnostic_fn)(const char *, ...) ATTRIBUTE_GCC_CXXDIAG(1,2);
if (convs->bad_p if (convs->bad_p
&& convs->kind != ck_user && convs->kind != ck_user
......
...@@ -4467,7 +4467,7 @@ build_compound_expr (tree lhs, tree rhs) ...@@ -4467,7 +4467,7 @@ build_compound_expr (tree lhs, tree rhs)
static void static void
check_for_casting_away_constness (tree src_type, tree dest_type, 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) const char *description)
{ {
if (diag_fn && casts_away_constness (src_type, dest_type)) 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, ...@@ -4521,7 +4521,7 @@ build_static_cast_1 (tree type, tree expr, bool c_cast_p,
tree intype; tree intype;
tree result; tree result;
tree orig; tree orig;
void (*diag_fn)(const char*, ...); void (*diag_fn)(const char*, ...) ATTRIBUTE_GCC_CXXDIAG(1,2);
const char *desc; const char *desc;
/* Assume the cast is valid. */ /* Assume the cast is valid. */
......
...@@ -74,7 +74,7 @@ void ...@@ -74,7 +74,7 @@ void
readonly_error (tree arg, const char* string, int soft) readonly_error (tree arg, const char* string, int soft)
{ {
const char *fmt; const char *fmt;
void (*fn) (const char *, ...); void (*fn) (const char *, ...) ATTRIBUTE_GCC_CXXDIAG(1,2);
if (soft) if (soft)
fn = pedwarn; fn = pedwarn;
...@@ -347,8 +347,8 @@ void ...@@ -347,8 +347,8 @@ void
cxx_incomplete_type_diagnostic (tree value, tree type, int diag_type) cxx_incomplete_type_diagnostic (tree value, tree type, int diag_type)
{ {
int decl = 0; int decl = 0;
void (*p_msg) (const char *, ...); void (*p_msg) (const char *, ...) ATTRIBUTE_GCC_CXXDIAG(1,2);
void (*p_msg_at) (const char *, ...); void (*p_msg_at) (const char *, ...) ATTRIBUTE_GCC_CXXDIAG(1,2);
if (diag_type == 1) if (diag_type == 1)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment