aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2005-06-18 15:07:28 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2005-06-18 15:07:28 +0000
commiteb2de0c09d794650494cdca09b5613fbf374fb86 (patch)
tree66a8d3455877c4ffc86ef5c9f01e5b1e382b51f9 /gcc/cp
parent2c8b10961fa33abb06d8acebffa4ac3eaec82086 (diff)
downloadgcc-eb2de0c09d794650494cdca09b5613fbf374fb86.zip
gcc-eb2de0c09d794650494cdca09b5613fbf374fb86.tar.gz
gcc-eb2de0c09d794650494cdca09b5613fbf374fb86.tar.bz2
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
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/call.c2
-rw-r--r--gcc/cp/typeck.c4
-rw-r--r--gcc/cp/typeck2.c6
4 files changed, 14 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 3f795aa..7fbbef0b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index d245171..d3daadb 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 58ba079..ca45527 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 5094064..f5cbfe5 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)
{