summaryrefslogtreecommitdiff
path: root/gcc/c-parse.in
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2003-09-15 11:31:17 +0200
committerAndreas Jaeger <aj@gcc.gnu.org>2003-09-15 11:31:17 +0200
commitc034f12167b8e88ea94f496f7f786064b9074814 (patch)
treee8af0c2a48f55bb04305f893645f855b6871b356 /gcc/c-parse.in
parent863d938c6a762da34248523b4424d9052e28555d (diff)
downloadgcc-c034f12167b8e88ea94f496f7f786064b9074814.tar.gz
invoke.texi (Warning Options): Describe -Wold-style-definition.
2003-09-15 Andreas Jaeger <aj@suse.de> Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * doc/invoke.texi (Warning Options): Describe -Wold-style-definition. * c-opts.c (c_common_handle_option): Handle OPT_Wold_style_definition. * c-parse.in: Warn about old-style parameter definition. * c-common.c: Define warn_old_style_defintion. * c-common.h: Declare it. * c.opt: Add Wold-style-defintion. testsuite: 2003-09-15 Andreas Jaeger <aj@suse.de> * gcc.dg/Wold-style-definition-1.c: New test. From-SVN: r71400
Diffstat (limited to 'gcc/c-parse.in')
-rw-r--r--gcc/c-parse.in7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/c-parse.in b/gcc/c-parse.in
index 1338455fda5..bb9cc1a7703 100644
--- a/gcc/c-parse.in
+++ b/gcc/c-parse.in
@@ -757,9 +757,16 @@ old_style_parm_decls_1:
if (warn_traditional && !in_system_header
&& parsing_iso_function_signature)
warning ("traditional C rejects ISO C style function definitions");
+ if (warn_old_style_definition && !in_system_header
+ && !parsing_iso_function_signature)
+ warning ("old-style parameter declaration");
parsing_iso_function_signature = false; /* Reset after warning. */
}
| datadecls
+ {
+ if (warn_old_style_definition && !in_system_header)
+ warning ("old-style parameter declaration");
+ }
;
/* The following are analogous to lineno_decl, decls and decl