Index: gcc/doc/invoke.texi =================================================================== --- gcc/doc/invoke.texi (revision 119963) +++ gcc/doc/invoke.texi (working copy) @@ -255,7 +255,8 @@ Objective-C and Objective-C++ Dialects}. @item C-only Warning Options @gccoptlist{-Wbad-function-cast -Wmissing-declarations @gol --Wmissing-prototypes -Wnested-externs -Wold-style-definition @gol +-Wmissing-parameter-type -Wmissing-prototypes @gol +-Wnested-externs -Wold-style-definition @gol -Wstrict-prototypes -Wtraditional -Wtraditional-conversion @gol -Wdeclaration-after-statement -Wpointer-sign} @@ -2907,13 +2908,10 @@ designated initializers (@pxref{Designat Initializers}). This warning can be independently controlled by @option{-Woverride-init}. -@item +@item @r{(C only)} A function parameter is declared without a type specifier in K&R-style -functions: - -@smallexample -void foo(bar) @{ @} -@end smallexample +functions. This warning can be independently controlled by +@option{-Wmissing-parameter-type}. @item An empty body occurs in an @samp{if} or @samp{else} statement. This @@ -3214,6 +3212,17 @@ types.) Warn if an old-style function definition is used. A warning is given even if there is a previous prototype. +@item -Wmissing-parameter-type @r{(C only)} +@opindex Wmissing-parameter-type +A function parameter is declared without a type specifier in K&R-style +functions: + +@smallexample +void foo(bar) @{ @} +@end smallexample + +This warning is also enabled by @option{-Wextra}. + @item -Wmissing-prototypes @r{(C only)} @opindex Wmissing-prototypes Warn if a global function is defined without a previous prototype Index: gcc/c-decl.c =================================================================== --- gcc/c-decl.c (revision 119963) +++ gcc/c-decl.c (working copy) @@ -6414,8 +6414,8 @@ store_parm_decls_oldstyle (tree fndecl, if (flag_isoc99) pedwarn ("type of %q+D defaults to %", decl); - else if (extra_warnings) - warning (OPT_Wextra, "type of %q+D defaults to %", decl); + else + warning (OPT_Wmissing_parameter_type, "type of %q+D defaults to %", decl); } TREE_PURPOSE (parm) = decl; Index: gcc/c.opt =================================================================== --- gcc/c.opt (revision 119963) +++ gcc/c.opt (working copy) @@ -279,6 +279,10 @@ Wmissing-include-dirs C ObjC C++ ObjC++ Warn about user-specified include directories that do not exist +Wmissing-parameter-type +C ObjC Var(warn_missing_parameter_type) Init(-1) +Warn about function parameters declared without a type specifier in K&R-style functions + Wmissing-prototypes C ObjC Var(warn_missing_prototypes) Warn about global functions without prototypes Index: gcc/c-opts.c =================================================================== --- gcc/c-opts.c (revision 119963) +++ gcc/c-opts.c (working copy) @@ -1025,9 +1025,11 @@ c_common_post_options (const char **pfil if (flag_objc_exceptions && !flag_objc_sjlj_exceptions) flag_exceptions = 1; - /* -Wextra implies -Wempty-body, -Wsign-compare, - -Wmissing-field-initializers and -Woverride-init, + /* -Wextra implies -Wmissing-parameter-type, -Wempty-body, + -Wsign-compare, -Wmissing-field-initializers and -Woverride-init, but not if explicitly overridden. */ + if (warn_missing_parameter_type == -1) + warn_missing_parameter_type = extra_warnings; if (warn_empty_body == -1) warn_empty_body = extra_warnings; if (warn_sign_compare == -1)