diff options
author | Richard Henderson <rth@gcc.gnu.org> | 2000-06-26 09:42:23 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2000-06-26 09:42:23 -0700 |
commit | 903f51d97fc06fde3900a9628872007bf71eecac (patch) | |
tree | 3775b34b16d78fb402deb53f4c3ecccc2f5d7168 /gcc/c-decl.c | |
parent | 774d2baf5040b0a86bb07931e01b4d2811611eab (diff) | |
download | gcc-903f51d97fc06fde3900a9628872007bf71eecac.zip gcc-903f51d97fc06fde3900a9628872007bf71eecac.tar.gz gcc-903f51d97fc06fde3900a9628872007bf71eecac.tar.bz2 |
[multiple changes]
2000-06-26 Joseph S. Myers <jsm28@cam.ac.uk>
* c-decl.c (grokdeclarator): Don't warn about `long long' in C99.
Make warnings about implicit int be pedwarns in C99. Don't warn
about duplicate type qualifiers in C99.
(start_function): Make warning about implict int return type be a
pedwarn in C99.
* c-lex.c (yylex): Don't warn about `long long' in C99.
* c-typeck.c (c_expand_return): In C99, always pedwarn about
`return' with no value in function returning non-void.
2000-06-26 Richard Henderson <rth@cygnus.com>
* c-typeck.c (pedwarn_c99): New.
* diagnostic.c (verror, vwarning, vpedwarn): Export.
* toplev.h: Prototype them.
From-SVN: r34713
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index cabc4c1..54acc37 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -3955,7 +3955,8 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) error ("`long long long' is too long for GCC"); else { - if (pedantic && ! in_system_header && warn_long_long) + if (pedantic && !flag_isoc99 && ! in_system_header + && warn_long_long) pedwarn ("ANSI C does not support `long long'"); longlong = 1; } @@ -4018,7 +4019,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) if ((warn_implicit_int || warn_return_type) && funcdef_flag) warn_about_return_type = 1; else if (warn_implicit_int || flag_isoc99) - warning ("type defaults to `int' in declaration of `%s'", name); + pedwarn_c99 ("type defaults to `int' in declaration of `%s'", name); } defaulted_int = 1; @@ -4168,11 +4169,11 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) restrictp = !! (specbits & 1 << (int) RID_RESTRICT) + TYPE_RESTRICT (type); volatilep = !! (specbits & 1 << (int) RID_VOLATILE) + TYPE_VOLATILE (type); inlinep = !! (specbits & (1 << (int) RID_INLINE)); - if (constp > 1) + if (constp > 1 && ! flag_isoc99) pedwarn ("duplicate `const'"); - if (restrictp > 1) + if (restrictp > 1 && ! flag_isoc99) pedwarn ("duplicate `restrict'"); - if (volatilep > 1) + if (volatilep > 1 && ! flag_isoc99) pedwarn ("duplicate `volatile'"); if (! flag_gen_aux_info && (TYPE_QUALS (type))) type = TYPE_MAIN_VARIANT (type); @@ -4526,11 +4527,11 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) error ("invalid type modifier within pointer declarator"); } } - if (constp > 1) + if (constp > 1 && ! flag_isoc99) pedwarn ("duplicate `const'"); - if (volatilep > 1) + if (volatilep > 1 && ! flag_isoc99) pedwarn ("duplicate `volatile'"); - if (restrictp > 1) + if (restrictp > 1 && ! flag_isoc99) pedwarn ("duplicate `restrict'"); type_quals = ((constp ? TYPE_QUAL_CONST : 0) @@ -5743,7 +5744,7 @@ start_function (declspecs, declarator, prefix_attributes, attributes) if (!COMPLETE_OR_VOID_TYPE_P (TREE_TYPE (TREE_TYPE (decl1)))) { - error ("return-type is an incomplete type"); + error ("return type is an incomplete type"); /* Make it return void instead. */ TREE_TYPE (decl1) = build_function_type (void_type_node, @@ -5751,7 +5752,7 @@ start_function (declspecs, declarator, prefix_attributes, attributes) } if (warn_about_return_type) - warning ("return-type defaults to `int'"); + pedwarn_c99 ("return type defaults to `int'"); /* Save the parm names or decls from this function's declarator where store_parm_decls will find them. */ |