+2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
+
+ * c-common.h (GCC_DIAG_STYLE): Define earlier in the file,
+ before including diagnostic-core.h.
+ (c_cpp_error): New prototype moved from c-tree.h.
+ Use ATTRIBUTE_GCC_DIAG instead of ATTRIBUTE_GCC_CDIAG.
+ * c-tree.h (ATTRIBUTE_GCC_CDIAG): Remove define.
+ (pedwarn_c90, perwarn_c99): Use ATTRIBUTE_GCC_DIAG instead.
+ (c_cpp_error): Prototype moved to c-common.h.
+ * Makefile.in: Update dependency for C_COMMON_H.
+
2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
* c-common.h: Add FIXME for awkward split of c_register_addr_space.
TIMEVAR_H = timevar.h timevar.def
INSN_ATTR_H = insn-attr.h $(INSN_ADDR_H)
INSN_ADDR_H = $(srcdir)/insn-addr.h vecprim.h
-C_COMMON_H = c-common.h $(SPLAY_TREE_H) $(CPPLIB_H) $(GGC_H)
+C_COMMON_H = c-common.h $(SPLAY_TREE_H) $(CPPLIB_H) $(GGC_H) $(DIAGNOSTIC_CORE_H)
C_PRAGMA_H = c-pragma.h $(CPPLIB_H)
C_TREE_H = c-tree.h $(C_COMMON_H) $(TOPLEV_H) $(DIAGNOSTIC_H)
SYSTEM_H = system.h hwint.h $(srcdir)/../include/libiberty.h \
#include "cpplib.h"
#include "ggc.h"
+/* In order for the format checking to accept the C frontend
+ diagnostic framework extensions, you must include this file before
+ toplev.h, not after. The C front end formats are a subset of those
+ for C++, so they are the appropriate set to use in common code;
+ cp-tree.h overrides this for C++. */
+#ifndef GCC_DIAG_STYLE
+#define GCC_DIAG_STYLE __gcc_cdiag__
+#endif
+#include "diagnostic-core.h"
+
/* Usage of TREE_LANG_FLAG_?:
0: TREE_NEGATED_INT (in INTEGER_CST).
IDENTIFIER_MARKED (used by search routines).
extern void c_cpp_builtins (cpp_reader *);
extern void c_cpp_builtins_optimize_pragma (cpp_reader *, tree, tree);
+extern bool c_cpp_error (cpp_reader *, int, int, location_t, unsigned int,
+ const char *, va_list *)
+ ATTRIBUTE_GCC_DIAG(6,0);
/* Positive if an implicit `extern "C"' scope has just been entered;
negative if such a scope has just been exited. */
extern tree c_omp_remap_decl (tree, bool);
extern void record_types_used_by_current_var_decl (tree);
-/* In order for the format checking to accept the C frontend
- diagnostic framework extensions, you must include this file before
- toplev.h, not after. The C front end formats are a subset of those
- for C++, so they are the appropriate set to use in common code;
- cp-tree.h overrides this for C++. */
-#ifndef GCC_DIAG_STYLE
-#define GCC_DIAG_STYLE __gcc_cdiag__
-#endif
-
#endif /* ! GCC_C_COMMON_H */
extern void c_finish_incomplete_decl (tree);
extern void c_write_global_declarations (void);
-/* In order for the format checking to accept the C frontend
- diagnostic framework extensions, you must include this file before
- toplev.h, not after. */
-#if GCC_VERSION >= 4001
-#define ATTRIBUTE_GCC_CDIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m ,n))) ATTRIBUTE_NONNULL(m)
-#else
-#define ATTRIBUTE_GCC_CDIAG(m, n) ATTRIBUTE_NONNULL(m)
-#endif
-
-extern void pedwarn_c90 (location_t, int opt, const char *, ...) ATTRIBUTE_GCC_CDIAG(3,4);
-extern void pedwarn_c99 (location_t, int opt, const char *, ...) ATTRIBUTE_GCC_CDIAG(3,4);
-
-extern bool c_cpp_error (cpp_reader *, int, int, location_t, unsigned int,
- const char *, va_list *)
- ATTRIBUTE_GCC_CDIAG(6,0);
+/* In c-errors.c */
+extern void pedwarn_c90 (location_t, int opt, const char *, ...) ATTRIBUTE_GCC_DIAG(3,4);
+extern void pedwarn_c99 (location_t, int opt, const char *, ...) ATTRIBUTE_GCC_DIAG(3,4);
#endif /* ! GCC_C_TREE_H */
+2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
+
+ * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove. Require that
+ this file is included before c-common.h. Define GCC_DIAG_STYLE
+ before including diagnostic-core.h and toplev.h.
+ (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG.
+ * pt.c: Include cp-tree.h before c-common.h.
+
2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
* tree.c (c_register_addr_space): Add stub.
#include "function.h"
#include "hashtab.h"
#include "vec.h"
-#include "c-common.h"
-#include "name-lookup.h"
/* In order for the format checking to accept the C++ front end
diagnostic framework extensions, you must include this file before
in c-common.h. */
#undef GCC_DIAG_STYLE
#define GCC_DIAG_STYLE __gcc_cxxdiag__
-#if GCC_VERSION >= 4001
-#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
-#ifdef GCC_TOPLEV_H
+#if defined(GCC_TOPLEV_H) || defined (GCC_C_COMMON_H)
#error \
In order for the format checking to accept the C++ front end diagnostic \
-framework extensions, you must include this file before toplev.h, not after.
+framework extensions, you must include this file before toplev.h and \
+c-common.h, not after.
#endif
#include "toplev.h"
#include "diagnostic.h"
+#include "c-common.h"
+
+#include "name-lookup.h"
/* Usage of TREE_LANG_FLAG_?:
0: IDENTIFIER_MARKED (IDENTIFIER_NODEs)
extern void print_instantiation_context (void);
extern void maybe_warn_variadic_templates (void);
extern void maybe_warn_cpp0x (cpp0x_warn_str str);
-extern bool pedwarn_cxx98 (location_t, int, const char *, ...) ATTRIBUTE_GCC_CXXDIAG(3,4);
+extern bool pedwarn_cxx98 (location_t, int, const char *, ...) ATTRIBUTE_GCC_DIAG(3,4);
/* in except.c */
extern void init_exception_processing (void);
#include "intl.h"
#include "pointer-set.h"
#include "flags.h"
-#include "c-common.h"
#include "cp-tree.h"
+#include "c-common.h"
#include "cp-objcp-common.h"
#include "tree-inline.h"
#include "decl.h"