diff options
author | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-04 15:15:38 +0000 |
---|---|---|
committer | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-04 15:15:38 +0000 |
commit | 754eb2f5aaf0131ebc8fd5da129d0f7285e83d73 (patch) | |
tree | 2537a481171fe231924d117a943f8cd28aebff61 /gcc/c-objc-common.c | |
parent | f7656ceb0357a6bdfc4f5f1e6f9f0f66bc82c6e2 (diff) | |
download | gcc-754eb2f5aaf0131ebc8fd5da129d0f7285e83d73.tar.gz |
2010-06-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/25880
* c-objc-common.c (c_tree_printer): Handle %V, %v and %#v.
* c-format.c (gcc_diag_flag_specs): Add hash.
(gcc_cxxdiag_flag_specs): Use gcc_diag_flag_specs directly.
(gcc_tdiag_char_table,gcc_cdiag_char_table): Handle %V and %v.
* c-pretty-print.c (pp_c_cv_qualifier): Rename as
pp_c_cv_qualifiers. Handle qualifiers spelling here.
(pp_c_type_qualifier_list): Call the function above.
* c-pretty-print.h (pp_c_cv_qualifiers): Declare.
* c-typeck.c (handle_warn_cast_qual): Print qualifiers.
(WARN_FOR_QUALIFIERS): New macro.
(convert_for_assignment): Use it.
testsuite/
* gcc.dg/assign-warn-2.c: Update.
* gcc.dg/cpp/line3.c: Update.
* gcc.dg/c99-array-lval-8.c: Update.
* gcc.dg/cast-qual-2.c: Update.
* gcc.dg/c99-arraydecl-3.c: Update.
* gcc.dg/assign-warn-1.c: Update.
* gcc.dg/format/gcc_diag-1.c: Update.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160274 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-objc-common.c')
-rw-r--r-- | gcc/c-objc-common.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/gcc/c-objc-common.c b/gcc/c-objc-common.c index fccc2635fa8..7694a38d999 100644 --- a/gcc/c-objc-common.c +++ b/gcc/c-objc-common.c @@ -79,9 +79,10 @@ c_objc_common_init (void) %E: an identifier or expression, %F: a function declaration, %T: a type. + %V: a list of type qualifiers from a tree. + %v: an explicit list of type qualifiers + %#v: an explicit list of type qualifiers of a function type. - These format specifiers form a subset of the format specifiers set used - by the C++ front-end. Please notice when called, the `%' part was already skipped by the diagnostic machinery. */ static bool @@ -93,7 +94,7 @@ c_tree_printer (pretty_printer *pp, text_info *text, const char *spec, c_pretty_printer *cpp = (c_pretty_printer *) pp; pp->padding = pp_none; - if (precision != 0 || wide || hash) + if (precision != 0 || wide) return false; if (*spec == 'K') @@ -102,10 +103,12 @@ c_tree_printer (pretty_printer *pp, text_info *text, const char *spec, return true; } - t = va_arg (*text->args_ptr, tree); - - if (set_locus && text->locus) - *text->locus = DECL_SOURCE_LOCATION (t); + if (*spec != 'v') + { + t = va_arg (*text->args_ptr, tree); + if (set_locus && text->locus) + *text->locus = DECL_SOURCE_LOCATION (t); + } switch (*spec) { @@ -155,6 +158,14 @@ c_tree_printer (pretty_printer *pp, text_info *text, const char *spec, pp_expression (cpp, t); return true; + case 'V': + pp_c_type_qualifier_list (cpp, t); + return true; + + case 'v': + pp_c_cv_qualifiers (cpp, va_arg (*text->args_ptr, int), hash); + return true; + default: return false; } |