aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorGraham Stott <grahams@rcp.co.uk>1998-06-10 16:29:04 -0600
committerJeff Law <law@gcc.gnu.org>1998-06-10 16:29:04 -0600
commite80716de42ff3e6f5893af0c20bde051168b87e6 (patch)
tree4d7351438a56352be617f1676b9c6c07c93203c5 /gcc/c-decl.c
parente76e4a6842e855c0be437fcb1d0079e9323d8231 (diff)
downloadgcc-e80716de42ff3e6f5893af0c20bde051168b87e6.zip
gcc-e80716de42ff3e6f5893af0c20bde051168b87e6.tar.gz
gcc-e80716de42ff3e6f5893af0c20bde051168b87e6.tar.bz2
* c-decl.c (start_decl): Correct test for -Wmain.
From-SVN: r20421
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 94dade7..dde17ad 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)