* c-decl.c (start_decl): Correct test for -Wmain.
authorGraham Stott <grahams@rcp.co.uk>
Wed, 10 Jun 1998 22:29:04 +0000 (16:29 -0600)
committerJeff Law <law@gcc.gnu.org>
Wed, 10 Jun 1998 22:29:04 +0000 (16:29 -0600)
From-SVN: r20421

gcc/ChangeLog
gcc/c-decl.c

index ce4b84a3537c3f48b03dab9e24c12e4be9a7e405..8940ad57f5241d2a77e7f7056a990bc2850a2aee 100644 (file)
@@ -1,3 +1,7 @@
+Wed Jun 10 23:23:17 1998  Graham  <grahams@rcp.co.uk>
+
+       * c-decl.c (start_decl): Correct test for -Wmain.
+
 Wed Jun 10 14:52:27 1998  Jim Wilson  <wilson@cygnus.com>
 
        * expr.c (expand_builtin_setjmp): Store const1_rtx in target.
@@ -15,7 +19,8 @@ Wed Jun 10 13:41:23 1998  Dave Brolley  <brolley@cygnus.com>
        * cppmain.c (fatal): New function.
        * configure.in (cpp_main): New configuration variable.
        * configure: Regenerated.
-       * Makefile.in (CCCP): Use a configuration variable to select base for cccp.
+       * Makefile.in (CCCP): Use a configuration variable to select basex
+       for cccp.
        (cppmain$(exeext)): Add @extra_cpp_objs@.
 
 Wed Jun 10 13:07:02 1998  Dave Brolley  <brolley@cygnus.com>
index 94dade7c279056d2c2d05ef704723c3b57cf9a74..dde17ad47740f53206f1b3e7d6ab9559e41d284d 100644 (file)
@@ -3690,7 +3690,8 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
   /* The corresponding pop_obstacks is in finish_decl.  */
   push_obstacks_nochange ();
 
-  if (warn_main && !strcmp (IDENTIFIER_POINTER (declarator), "main"))
+  if (warn_main && TREE_CODE (decl) != FUNCTION_DECL 
+      && !strcmp (IDENTIFIER_POINTER (DECL_NAME (decl)), "main"))
     warning_with_decl (decl, "`%s' is usually a function");
 
   if (initialized)