diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2003-07-04 01:55:50 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2003-07-04 01:55:50 +0000 |
commit | 5f1989e65d23624efdbf26bde56f375e3caa6a22 (patch) | |
tree | d40d3df53a09947e306cecdd4c52164ae5ff60fc /gcc/toplev.h | |
parent | 54c378f0438b6a1d718ef626389fff2ca91a0f9f (diff) | |
download | gcc-5f1989e65d23624efdbf26bde56f375e3caa6a22.tar.gz |
c-aux-info.c: Include toplev.h after c-tree.h.
gcc:
* c-aux-info.c: Include toplev.h after c-tree.h.
* c-common.c: Likewise.
(GCC_DIAG_STYLE): Undef.
* c-semantics.c (GCC_DIAG_STYLE): Define.
* c-tree.h (GCC_DIAG_STYLE): Likewise.
* diagnostic.h (inform): Move prototype to toplev.h.
* jump.c: Include diagnostic.h before toplev.h.
* toplev.h (GCC_DIAG_STYLE, ATTRIBUTE_GCC_DIAG): Define.
(warning, error, fatal_error, pedwarn, sorry, inform,
error_for_asm, warning_for_asm): Mark with ATTRIBUTE_GCC_CXXDIAG.
cp:
* cp-tree.h (GCC_DIAG_STYLE, ATTRIBUTE_GCC_CXXDIAG): Define.
(cp_error_at, cp_warning_at, cp_pedwarn_at): Mark with
ATTRIBUTE_GCC_CXXDIAG.
From-SVN: r68910
Diffstat (limited to 'gcc/toplev.h')
-rw-r--r-- | gcc/toplev.h | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/gcc/toplev.h b/gcc/toplev.h index 9cb3746db96..0be768f18ba 100644 --- a/gcc/toplev.h +++ b/gcc/toplev.h @@ -31,8 +31,6 @@ extern int read_integral_parameter (const char *, const char *, const int); extern void strip_off_ending (char *, int); extern const char *trim_filename (const char *); -extern void internal_error (const char *, ...) - ATTRIBUTE_NORETURN; extern void _fatal_insn_not_found (struct rtx_def *, const char *, int, const char *) @@ -48,15 +46,28 @@ extern void _fatal_insn (const char *, #define fatal_insn_not_found(insn) \ _fatal_insn_not_found (insn, __FILE__, __LINE__, __FUNCTION__) +/* If we haven't already defined a frontend specific diagnostics + style, use the generic one. */ +#ifndef GCC_DIAG_STYLE +#define GCC_DIAG_STYLE __gcc_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. */ -extern void warning (const char *, ...); -extern void error (const char *, ...); -extern void fatal_error (const char *, ...) + specifiers. We must use custom format checks. */ +#if GCC_VERSION >= 3004 +#define ATTRIBUTE_GCC_DIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m, n))) ATTRIBUTE_NONNULL(m) +#else +#define ATTRIBUTE_GCC_DIAG(m, n) ATTRIBUTE_NONNULL(m) +#endif +extern void internal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2) ATTRIBUTE_NORETURN; -extern void pedwarn (const char *, ...); -extern void sorry (const char *, ...); +extern void warning (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2); +extern void error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2); +extern void fatal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2) + ATTRIBUTE_NORETURN; +extern void pedwarn (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2); +extern void sorry (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2); +extern void inform (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2); extern void rest_of_decl_compilation (union tree_node *, const char *, int, int); @@ -73,9 +84,9 @@ extern void error_with_decl (union tree_node *, extern void announce_function (union tree_node *); extern void error_for_asm (struct rtx_def *, - const char *, ...); + const char *, ...) ATTRIBUTE_GCC_DIAG(2,3); extern void warning_for_asm (struct rtx_def *, - const char *, ...); + const char *, ...) ATTRIBUTE_GCC_DIAG(2,3); extern void warn_deprecated_use (union tree_node *); extern void output_clean_symbol_name (FILE *, const char *); |