c-decl.c (c_expand_body_1): Use C_DECL_FILE_SCOPE to detect main function.
authorGeoffrey Keating <geoffk@apple.com>
Tue, 29 Jul 2003 04:14:48 +0000 (04:14 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Tue, 29 Jul 2003 04:14:48 +0000 (04:14 +0000)
* c-decl.c (c_expand_body_1): Use C_DECL_FILE_SCOPE to detect
main function.

From-SVN: r69913

gcc/ChangeLog
gcc/c-decl.c

index c3059e557af1c74d1204ed7a9b78698791fca10c..dc9725702e4a8524f9c32df617eebe9d31769bc1 100644 (file)
@@ -1,3 +1,8 @@
+2003-07-28  Geoffrey Keating  <geoffk@apple.com>
+
+       * c-decl.c (c_expand_body_1): Use C_DECL_FILE_SCOPE to detect
+       main function.
+
 2003-07-28  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/11667
index 7923a1623b284ad1f206f213b5df25e7089d4970..6a87c427295db56324bb9a9772c5d32816e9ce72 100644 (file)
@@ -6338,7 +6338,7 @@ c_expand_body_1 (tree fndecl, int nested_p)
      to run global initializers, etc.  */
   if (DECL_NAME (fndecl)
       && MAIN_NAME_P (DECL_NAME (fndecl))
-      && DECL_CONTEXT (fndecl) == NULL_TREE)
+      && C_DECL_FILE_SCOPE (fndecl))
     expand_main_function ();
 
   /* Generate the RTL for this function.  */