Commit 82b5e52a by Joseph Myers Committed by Joseph Myers

toplev.h (NO_FRONT_END_DIAG, [...]): Define.

	* toplev.h (NO_FRONT_END_DIAG, ATTRIBUTE_GCC_FE_DIAG): Define.
	(warning, error, pedwarn, sorry): Use ATTRIBUTE_GCC_FE_DIAG.

cp:
	* decl.c (check_tag_decl): Name redeclared type in diagnostic.

From-SVN: r84174
parent b39edae3
2004-07-06 Joseph S. Myers <jsm@polyomino.org.uk>
* toplev.h (NO_FRONT_END_DIAG, ATTRIBUTE_GCC_FE_DIAG): Define.
(warning, error, pedwarn, sorry): Use ATTRIBUTE_GCC_FE_DIAG.
2004-07-06 Richard Henderson <rth@redhat.com> 2004-07-06 Richard Henderson <rth@redhat.com>
* config/i386/i386.c (legitimize_pic_address): Make static. * config/i386/i386.c (legitimize_pic_address): Make static.
......
2004-07-06 Joseph S. Myers <jsm@polyomino.org.uk>
* decl.c (check_tag_decl): Name redeclared type in diagnostic.
2004-07-06 Giovanni Bajo <giovannibajo@gcc.gnu.org> 2004-07-06 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/3671 PR c++/3671
......
...@@ -3424,7 +3424,7 @@ check_tag_decl (cp_decl_specifier_seq *declspecs) ...@@ -3424,7 +3424,7 @@ check_tag_decl (cp_decl_specifier_seq *declspecs)
else if (declspecs->redefined_builtin_type) else if (declspecs->redefined_builtin_type)
{ {
if (!in_system_header) if (!in_system_header)
pedwarn ("redeclaration of C++ built-in type", pedwarn ("redeclaration of C++ built-in type %qT",
declspecs->redefined_builtin_type); declspecs->redefined_builtin_type);
return NULL_TREE; return NULL_TREE;
} }
......
...@@ -45,23 +45,32 @@ extern void _fatal_insn (const char *, rtx, const char *, int, const char *) ...@@ -45,23 +45,32 @@ extern void _fatal_insn (const char *, rtx, const char *, int, const char *)
style, use the generic one. */ style, use the generic one. */
#ifndef GCC_DIAG_STYLE #ifndef GCC_DIAG_STYLE
#define GCC_DIAG_STYLE __gcc_diag__ #define GCC_DIAG_STYLE __gcc_diag__
#define NO_FRONT_END_DIAG
#endif #endif
/* None of these functions are suitable for ATTRIBUTE_PRINTF, because /* None of these functions are suitable for ATTRIBUTE_PRINTF, because
each language front end can extend them with its own set of format each language front end can extend them with its own set of format
specifiers. We must use custom format checks. */ specifiers. We must use custom format checks. Note that at present
the front-end %D specifier is used in non-front-end code with some
functions, and those formats can only be checked in front-end code. */
#if GCC_VERSION >= 3005 #if GCC_VERSION >= 3005
#define ATTRIBUTE_GCC_DIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m, n))) ATTRIBUTE_NONNULL(m) #define ATTRIBUTE_GCC_DIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m, n))) ATTRIBUTE_NONNULL(m)
#ifdef NO_FRONT_END_DIAG
#define ATTRIBUTE_GCC_FE_DIAG(m, n) ATTRIBUTE_NONNULL(m)
#else
#define ATTRIBUTE_GCC_FE_DIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m, n))) ATTRIBUTE_NONNULL(m)
#endif
#else #else
#define ATTRIBUTE_GCC_DIAG(m, n) ATTRIBUTE_NONNULL(m) #define ATTRIBUTE_GCC_DIAG(m, n) ATTRIBUTE_NONNULL(m)
#define ATTRIBUTE_GCC_FE_DIAG(m, n) ATTRIBUTE_NONNULL(m)
#endif #endif
extern void internal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2) extern void internal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
ATTRIBUTE_NORETURN; ATTRIBUTE_NORETURN;
extern void warning (const char *, ...); extern void warning (const char *, ...) ATTRIBUTE_GCC_FE_DIAG(1,2);
extern void error (const char *, ...); extern void error (const char *, ...) ATTRIBUTE_GCC_FE_DIAG(1,2);
extern void fatal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2) extern void fatal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
ATTRIBUTE_NORETURN; ATTRIBUTE_NORETURN;
extern void pedwarn (const char *, ...); extern void pedwarn (const char *, ...) ATTRIBUTE_GCC_FE_DIAG(1,2);
extern void sorry (const char *, ...); extern void sorry (const char *, ...) ATTRIBUTE_GCC_FE_DIAG(1,2);
extern void inform (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2); extern void inform (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
extern void rest_of_decl_compilation (tree, const char *, int, int); extern void rest_of_decl_compilation (tree, const char *, int, int);
......
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