aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.h
diff options
context:
space:
mode:
authorJoseph Myers <jsm@polyomino.org.uk>2004-07-06 23:42:45 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2004-07-06 23:42:45 +0100
commit82b5e52a9e41fbc4893f2dd0d2ba99bb2db70f4c (patch)
treedfa11bc5308fed458a1f6489e263f02721dcce69 /gcc/toplev.h
parentb39edae36eba74d4e0bdf5049544bb5f86dbe8bd (diff)
downloadgcc-82b5e52a9e41fbc4893f2dd0d2ba99bb2db70f4c.zip
gcc-82b5e52a9e41fbc4893f2dd0d2ba99bb2db70f4c.tar.gz
gcc-82b5e52a9e41fbc4893f2dd0d2ba99bb2db70f4c.tar.bz2
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
Diffstat (limited to 'gcc/toplev.h')
-rw-r--r--gcc/toplev.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/gcc/toplev.h b/gcc/toplev.h
index 1940252..6f6cad3 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -45,23 +45,32 @@ extern void _fatal_insn (const char *, rtx, const char *, int, const char *)
style, use the generic one. */
#ifndef GCC_DIAG_STYLE
#define GCC_DIAG_STYLE __gcc_diag__
+#define NO_FRONT_END_DIAG
#endif
/* None of these functions are suitable for ATTRIBUTE_PRINTF, because
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
#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
#define ATTRIBUTE_GCC_DIAG(m, n) ATTRIBUTE_NONNULL(m)
+#define ATTRIBUTE_GCC_FE_DIAG(m, n) ATTRIBUTE_NONNULL(m)
#endif
extern void internal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
ATTRIBUTE_NORETURN;
-extern void warning (const char *, ...);
-extern void error (const char *, ...);
+extern void warning (const char *, ...) ATTRIBUTE_GCC_FE_DIAG(1,2);
+extern void error (const char *, ...) ATTRIBUTE_GCC_FE_DIAG(1,2);
extern void fatal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
ATTRIBUTE_NORETURN;
-extern void pedwarn (const char *, ...);
-extern void sorry (const char *, ...);
+extern void pedwarn (const char *, ...) ATTRIBUTE_GCC_FE_DIAG(1,2);
+extern void sorry (const char *, ...) ATTRIBUTE_GCC_FE_DIAG(1,2);
extern void inform (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
extern void rest_of_decl_compilation (tree, const char *, int, int);