diff options
author | Joseph Myers <jsm@polyomino.org.uk> | 2004-07-01 09:52:33 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2004-07-01 09:52:33 +0100 |
commit | ede1a3872913df59f3a1f4299ec5f6c7706d3b7b (patch) | |
tree | 5e14fad8701c2b2a0d71a2e08df216891b59d315 /gcc/c-lang.c | |
parent | d59c7b4bdca296330783083e285ec0fab406df28 (diff) | |
download | gcc-ede1a3872913df59f3a1f4299ec5f6c7706d3b7b.zip gcc-ede1a3872913df59f3a1f4299ec5f6c7706d3b7b.tar.gz gcc-ede1a3872913df59f3a1f4299ec5f6c7706d3b7b.tar.bz2 |
re PR c/1027 (slightly misleading printf format warning)
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.
From-SVN: r83965
Diffstat (limited to 'gcc/c-lang.c')
-rw-r--r-- | gcc/c-lang.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/gcc/c-lang.c b/gcc/c-lang.c index 03b05b2..14ffea6 100644 --- a/gcc/c-lang.c +++ b/gcc/c-lang.c @@ -34,8 +34,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "diagnostic.h" #include "c-pretty-print.h" -static void c_initialize_diagnostics (diagnostic_context *); - enum c_language_kind c_language = clk_c; /* ### When changing hooks, consider if ObjC needs changing too!! ### */ @@ -210,17 +208,5 @@ c_types_compatible_p (tree x, tree y) { return comptypes (TYPE_MAIN_VARIANT (x), TYPE_MAIN_VARIANT (y)); } -static void -c_initialize_diagnostics (diagnostic_context *context) -{ - pretty_printer *base = context->printer; - c_pretty_printer *pp = xmalloc (sizeof (c_pretty_printer)); - memcpy (pp_base (pp), base, sizeof (pretty_printer)); - pp_c_pretty_printer_init (pp); - context->printer = (pretty_printer *) pp; - - /* It is safe to free this object because it was previously malloc()'d. */ - free (base); -} #include "gtype-c.h" |