From 6976ae513f494a12d8dbc4c80d2b0dcd85a5c7c0 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 7 Jun 2011 17:52:46 -0400 Subject: [PATCH] pretty-print.h (ATTRIBUTE_GCC_PPDIAG): Use GCC_DIAG_STYLE if set. gcc/ * pretty-print.h (ATTRIBUTE_GCC_PPDIAG): Use GCC_DIAG_STYLE if set. gcc/c-family/ * c-format.c (gcc_cxxdiag_char_table): Add 'S' format. From-SVN: r174770 --- gcc/ChangeLog | 4 ++++ gcc/c-family/ChangeLog | 4 ++++ gcc/c-family/c-format.c | 2 +- gcc/pretty-print.h | 10 +++++++++- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 98bda5ce873..6c1a5c2038c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2011-06-07 Jason Merrill + + * pretty-print.h (ATTRIBUTE_GCC_PPDIAG): Use GCC_DIAG_STYLE if set. + 2011-06-07 Xinliang David Li * passes.c (enable_disable_pass): Handle assembler name. (is_pass_explicitly_enabled_or_disabled): Ditto. diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 1c5f9d3e001..0e71e376d5e 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,7 @@ +2011-06-07 Jason Merrill + + * c-format.c (gcc_cxxdiag_char_table): Add 'S' format. + 2011-06-07 Richard Guenther * c-common.c (c_common_nodes_and_builtins): Do not set diff --git a/gcc/c-family/c-format.c b/gcc/c-family/c-format.c index 66012c4a88e..9fabc399565 100644 --- a/gcc/c-family/c-format.c +++ b/gcc/c-family/c-format.c @@ -740,7 +740,7 @@ static const format_char_info gcc_cxxdiag_char_table[] = /* Custom conversion specifiers. */ /* These will require a "tree" at runtime. */ - { "ADEFKTV",0,STD_C89,{ T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q+#", "", NULL }, + { "ADEFKSTV",0,STD_C89,{ T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q+#", "", NULL }, { "v", 0,STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q#", "", NULL }, diff --git a/gcc/pretty-print.h b/gcc/pretty-print.h index 3b6d18e9254..ae1dadfe4a6 100644 --- a/gcc/pretty-print.h +++ b/gcc/pretty-print.h @@ -303,10 +303,18 @@ extern const char *pp_base_last_position_in_text (const pretty_printer *); extern void pp_base_emit_prefix (pretty_printer *); extern void pp_base_append_text (pretty_printer *, const char *, const char *); +/* If we haven't already defined a front-end-specific diagnostics + style, use the generic one. */ +#ifdef GCC_DIAG_STYLE +#define GCC_PPDIAG_STYLE GCC_DIAG_STYLE +#else +#define GCC_PPDIAG_STYLE __gcc_diag__ +#endif + /* This header may be included before diagnostics-core.h, hence the duplicate definitions to allow for GCC-specific formats. */ #if GCC_VERSION >= 3005 -#define ATTRIBUTE_GCC_PPDIAG(m, n) __attribute__ ((__format__ (__gcc_diag__, m ,n))) ATTRIBUTE_NONNULL(m) +#define ATTRIBUTE_GCC_PPDIAG(m, n) __attribute__ ((__format__ (GCC_PPDIAG_STYLE, m ,n))) ATTRIBUTE_NONNULL(m) #else #define ATTRIBUTE_GCC_PPDIAG(m, n) ATTRIBUTE_NONNULL(m) #endif -- 2.30.2