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: Petter Reinholdtsen <pere@hungry.com>
To: gcc-bugs@gcc.gnu.org,  gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org,
  gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c/8754: Allows illegal code
Date: 04 Dec 2002 13:21:18 +0100

 [Volker Reichelt]
 > 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.
 
 OK.  So GCC is not an ANSI C compiler by default.  I would like it to
 be, but I realise the GCC developers do not want that at the moment.
 
 Could I request a warning by default in the case above, about the
 variable (or local function) hiding the symbol for the current
 function?


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