aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2000-07-12 20:15:20 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2000-07-12 20:15:20 +0000
commit895ea61453c945cced3974a35173dd58c7753758 (patch)
treee7fca6dc3d8c848108c755daa00e7fe40a2c41e3 /gcc/c-decl.c
parent8364301f5a1725e900f4554f5d9358146c804ee3 (diff)
downloadgcc-895ea61453c945cced3974a35173dd58c7753758.zip
gcc-895ea61453c945cced3974a35173dd58c7753758.tar.gz
gcc-895ea61453c945cced3974a35173dd58c7753758.tar.bz2
c-decl.c (define_label): Warn about identifier conflicts with labels in traditional C.
* c-decl.c (define_label): Warn about identifier conflicts with labels in traditional C. * c-parse.in (unop +): Warn about the unary plus operator for traditional C. * c-typeck.c (store_init_value): Warn about automatic aggregate initialization for traditional C. * invoke.texi (-Wtraditional): Document new warnings. From-SVN: r34997
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 619c20c..f212e18 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -2706,6 +2706,10 @@ define_label (filename, line, name)
decl = lookup_label (name);
}
+ if (warn_traditional && lookup_name (name))
+ warning ("traditional C lacks a separate namespace for labels, identifier `%s' conflicts",
+ IDENTIFIER_POINTER (name));
+
if (DECL_INITIAL (decl) != 0)
{
error ("duplicate label `%s'", IDENTIFIER_POINTER (name));