summaryrefslogtreecommitdiffstats
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-06-10 22:29:04 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-06-10 22:29:04 +0000
commit08977d58a7f878c1d388785a538c4f22828e1ee8 (patch)
tree4d7351438a56352be617f1676b9c6c07c93203c5 /gcc/c-decl.c
parent933c2b12c97a6dd16102c5950df3dd82d61f17c7 (diff)
downloadppe42-gcc-08977d58a7f878c1d388785a538c4f22828e1ee8.tar.gz
ppe42-gcc-08977d58a7f878c1d388785a538c4f22828e1ee8.zip
* c-decl.c (start_decl): Correct test for -Wmain.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@20421 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 94dade7c279..dde17ad4774 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -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)
OpenPOWER on IntegriCloud