diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-01 08:52:33 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-01 08:52:33 +0000 |
commit | 31266980975ce05c3f41e92e112f873c9cfa9a05 (patch) | |
tree | 5e14fad8701c2b2a0d71a2e08df216891b59d315 /gcc/c-pretty-print.c | |
parent | 52d6bee4af7c047290440bcef095b2b11b5280f4 (diff) | |
download | gcc-31266980975ce05c3f41e92e112f873c9cfa9a05.tar.gz |
PR c/1027
* c-lang.c (c_initialize_diagnostics): Move from here ...
* c-objc-common.c: ... to here. Include "c-pretty-print.h".
(c_tree_printer): Use pretty-printer to format %T.
* c-pretty-print.c (pp_c_specifier_qualifier_list): Include space
before '*' if not C++.
(pp_c_direct_abstract_declarator): Don't try to print array upper
bound for flexible array members.
* c-tree.h: Include "diagnostic.h".
(c_initialize_diagnostics): Declare.
* objc/objc-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTICS): Define.
* c-format.c (format_type_warning): New function. Improve
diagnostics for incorrect format argument types.
(check_format_types): Use it. Add two parameters. Use the
TYPE_MAIN_VARIANT of wanted_type.
(check_format_info_main): Pass new parameters to
check_format_types.
(struct format_wanted_type): Update comment.
testsuite:
* gcc.dg/Wswitch-enum.c, gcc.dg/Wswitch.c,
gcc.dg/format/branch-1.c, gcc.dg/format/diag-1.c,
gcc.dg/format/multattr-3.c, gcc.dg/format/xopen-1.c: Update
expected warning text.
* gcc.dg/format/diag-2.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83965 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-pretty-print.c')
-rw-r--r-- | gcc/c-pretty-print.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/c-pretty-print.c b/gcc/c-pretty-print.c index fd3ef82ac02..e116f7f2984 100644 --- a/gcc/c-pretty-print.c +++ b/gcc/c-pretty-print.c @@ -384,6 +384,8 @@ pp_c_specifier_qualifier_list (c_pretty_printer *pp, tree t) pp_c_whitespace (pp); pp_c_left_paren (pp); } + else if (!c_dialect_cxx ()) + pp_c_whitespace (pp); pp_ptr_operator (pp, t); } break; @@ -487,7 +489,7 @@ pp_c_direct_abstract_declarator (c_pretty_printer *pp, tree t) case ARRAY_TYPE: pp_c_left_bracket (pp); - if (TYPE_DOMAIN (t)) + if (TYPE_DOMAIN (t) && TYPE_MAX_VALUE (TYPE_DOMAIN (t))) pp_expression (pp, TYPE_MAX_VALUE (TYPE_DOMAIN (t))); pp_c_right_bracket (pp); pp_direct_abstract_declarator (pp, TREE_TYPE (t)); |