This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c/8754: Allows illegal code


The following reply was made to PR c/8754; it has been noted by GNATS.

From: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
To: pere@hungry.com
Cc: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org,
        gcc-gnats@gcc.gnu.org
Subject: Re: c/8754: Allows illegal code
Date: Fri, 29 Nov 2002 16:22:06 +0100

 On 29 Nov, Petter Reinholdtsen wrote:
 >>     Not a bug.
 >>     Nested functions are a GNU extension, see
 >>     http://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Nested-Functions.html
 > 
 > And function overloading for main() is well defined as well?
 
 This is not overloading. You can do the following (which is also
 accepted by SGI's compiler):
 
 int main()
 {
    double main=3;
    return main;
 }
 
 In your case the identifier main inside the outer function main is a
 function, not a double. That's the only difference.
 
 > Reimplementing main() inside main() is a bug, and should be flagged as such.
 
 Nope. See above.
 
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]