Commit 5f1989e6 by Kaveh R. Ghazi Committed by Kaveh Ghazi

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
parent 54c378f0
2003-07-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* 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.
2003-07-03 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> 2003-07-03 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
* cfglayout.c (cfg_layout_duplicate_bb): Do not update frequencies * cfglayout.c (cfg_layout_duplicate_bb): Do not update frequencies
......
...@@ -26,10 +26,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -26,10 +26,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "system.h" #include "system.h"
#include "coretypes.h" #include "coretypes.h"
#include "tm.h" #include "tm.h"
#include "toplev.h"
#include "flags.h" #include "flags.h"
#include "tree.h" #include "tree.h"
#include "c-tree.h" #include "c-tree.h"
#include "toplev.h"
enum formals_style_enum { enum formals_style_enum {
ansi, ansi,
......
...@@ -26,7 +26,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -26,7 +26,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "intl.h" #include "intl.h"
#include "tree.h" #include "tree.h"
#include "flags.h" #include "flags.h"
#include "toplev.h"
#include "output.h" #include "output.h"
#include "c-pragma.h" #include "c-pragma.h"
#include "rtl.h" #include "rtl.h"
...@@ -42,6 +41,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -42,6 +41,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "langhooks.h" #include "langhooks.h"
#include "tree-inline.h" #include "tree-inline.h"
#include "c-tree.h" #include "c-tree.h"
/* In order to ensure we use a common subset of valid specifiers
(between the various C family frontends) in this file, we restrict
ourselves to the generic specifier set. */
#undef GCC_DIAG_STYLE
#include "toplev.h"
cpp_reader *parse_in; /* Declared in c-pragma.h. */ cpp_reader *parse_in; /* Declared in c-pragma.h. */
......
...@@ -31,6 +31,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -31,6 +31,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "varray.h" #include "varray.h"
#include "c-common.h" #include "c-common.h"
#include "except.h" #include "except.h"
/* In order for the format checking to accept the C frontend
diagnostic framework extensions, you must define this token before
including toplev.h. */
#define GCC_DIAG_STYLE __gcc_cdiag__
#include "toplev.h" #include "toplev.h"
#include "flags.h" #include "flags.h"
#include "ggc.h" #include "ggc.h"
......
...@@ -305,4 +305,9 @@ extern void c_finish_incomplete_decl (tree); ...@@ -305,4 +305,9 @@ extern void c_finish_incomplete_decl (tree);
extern GTY(()) tree static_ctors; extern GTY(()) tree static_ctors;
extern GTY(()) tree static_dtors; extern GTY(()) tree static_dtors;
/* In order for the format checking to accept the C frontend
diagnostic framework extensions, you must include this file before
toplev.h, not after. */
#define GCC_DIAG_STYLE __gcc_cdiag__
#endif /* ! GCC_C_TREE_H */ #endif /* ! GCC_C_TREE_H */
2003-07-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* cp-tree.h (GCC_DIAG_STYLE, ATTRIBUTE_GCC_CXXDIAG): Define.
(cp_error_at, cp_warning_at, cp_pedwarn_at): Mark with
ATTRIBUTE_GCC_CXXDIAG.
2003-07-03 Mark Mitchell <mark@codesourcery.com> 2003-07-03 Mark Mitchell <mark@codesourcery.com>
* call.c (build_scoped_method_call): Use convert_to_void. * call.c (build_scoped_method_call): Use convert_to_void.
......
...@@ -3802,10 +3802,6 @@ extern tree set_guard (tree); ...@@ -3802,10 +3802,6 @@ extern tree set_guard (tree);
extern void prepare_assemble_variable (tree); extern void prepare_assemble_variable (tree);
extern void lower_function (tree); extern void lower_function (tree);
extern void cp_error_at (const char *msgid, ...);
extern void cp_warning_at (const char *msgid, ...);
extern void cp_pedwarn_at (const char *msgid, ...);
/* XXX Not i18n clean. */ /* XXX Not i18n clean. */
#define cp_deprecated(STR) \ #define cp_deprecated(STR) \
do { \ do { \
...@@ -4344,4 +4340,18 @@ extern bool cp_dump_tree (void *, tree); ...@@ -4344,4 +4340,18 @@ extern bool cp_dump_tree (void *, tree);
/* -- end of C++ */ /* -- end of C++ */
/* In order for the format checking to accept the C++ frontend
diagnostic framework extensions, you must include this file before
toplev.h, not after. */
#define GCC_DIAG_STYLE __gcc_cxxdiag__
#if GCC_VERSION >= 3004
#define ATTRIBUTE_GCC_CXXDIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m, n))) ATTRIBUTE_NONNULL(m)
#else
#define ATTRIBUTE_GCC_CXXDIAG(m, n) ATTRIBUTE_NONNULL(m)
#endif
extern void cp_error_at (const char *, ...) ATTRIBUTE_GCC_CXXDIAG(1, 2);
extern void cp_warning_at (const char *, ...) ATTRIBUTE_GCC_CXXDIAG(1, 2);
extern void cp_pedwarn_at (const char *, ...) ATTRIBUTE_GCC_CXXDIAG(1, 2);
#endif /* ! GCC_CP_TREE_H */ #endif /* ! GCC_CP_TREE_H */
...@@ -325,6 +325,5 @@ extern void output_printf (output_buffer *, const char *, ...) ...@@ -325,6 +325,5 @@ extern void output_printf (output_buffer *, const char *, ...)
extern void output_verbatim (output_buffer *, const char *, ...); extern void output_verbatim (output_buffer *, const char *, ...);
extern void verbatim (const char *, ...); extern void verbatim (const char *, ...);
extern char *file_name_as_prefix (const char *); extern char *file_name_as_prefix (const char *);
extern void inform (const char *, ...);
#endif /* ! GCC_DIAGNOSTIC_H */ #endif /* ! GCC_DIAGNOSTIC_H */
...@@ -50,11 +50,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -50,11 +50,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "expr.h" #include "expr.h"
#include "real.h" #include "real.h"
#include "except.h" #include "except.h"
#include "diagnostic.h"
#include "toplev.h" #include "toplev.h"
#include "reload.h" #include "reload.h"
#include "predict.h" #include "predict.h"
#include "timevar.h" #include "timevar.h"
#include "diagnostic.h"
/* Optimize jump y; x: ... y: jumpif... x? /* Optimize jump y; x: ... y: jumpif... x?
Don't know if it is worth bothering with. */ Don't know if it is worth bothering with. */
......
...@@ -31,8 +31,6 @@ extern int read_integral_parameter (const char *, const char *, ...@@ -31,8 +31,6 @@ extern int read_integral_parameter (const char *, const char *,
const int); const int);
extern void strip_off_ending (char *, int); extern void strip_off_ending (char *, int);
extern const char *trim_filename (const char *); extern const char *trim_filename (const char *);
extern void internal_error (const char *, ...)
ATTRIBUTE_NORETURN;
extern void _fatal_insn_not_found (struct rtx_def *, extern void _fatal_insn_not_found (struct rtx_def *,
const char *, int, const char *, int,
const char *) const char *)
...@@ -48,15 +46,28 @@ extern void _fatal_insn (const char *, ...@@ -48,15 +46,28 @@ extern void _fatal_insn (const char *,
#define fatal_insn_not_found(insn) \ #define fatal_insn_not_found(insn) \
_fatal_insn_not_found (insn, __FILE__, __LINE__, __FUNCTION__) _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 /* 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. */ specifiers. We must use custom format checks. */
extern void warning (const char *, ...); #if GCC_VERSION >= 3004
extern void error (const char *, ...); #define ATTRIBUTE_GCC_DIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m, n))) ATTRIBUTE_NONNULL(m)
extern void fatal_error (const char *, ...) #else
#define ATTRIBUTE_GCC_DIAG(m, n) ATTRIBUTE_NONNULL(m)
#endif
extern void internal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
ATTRIBUTE_NORETURN; ATTRIBUTE_NORETURN;
extern void pedwarn (const char *, ...); extern void warning (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
extern void sorry (const char *, ...); 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 *, extern void rest_of_decl_compilation (union tree_node *,
const char *, int, int); const char *, int, int);
...@@ -73,9 +84,9 @@ extern void error_with_decl (union tree_node *, ...@@ -73,9 +84,9 @@ extern void error_with_decl (union tree_node *,
extern void announce_function (union tree_node *); extern void announce_function (union tree_node *);
extern void error_for_asm (struct rtx_def *, 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 *, 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 warn_deprecated_use (union tree_node *);
extern void output_clean_symbol_name (FILE *, const char *); extern void output_clean_symbol_name (FILE *, const char *);
......
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