• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: gcc 4.2 generates error that was OK before
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gcc 4.2 generates error that was OK before


  • Subject: Re: gcc 4.2 generates error that was OK before
  • From: Alastair Houghton <email@hidden>
  • Date: Tue, 22 Sep 2009 21:22:54 +0100

On 22 Sep 2009, at 20:59, Markian Hlynka wrote:


It may be that the compiler is for some reason treating your function declaration as a declaration of a variable with an initialiser and then barfing.



Inunderstand what you're saying, but how does c++ usually determine the difference.

IIRC the rules are *hairy*, because there is no way syntactically to know whether e.g.


  Foo a(Bar);

is a function prototype or a statement initialising a variable "a" of type Foo, in which case Bar (depending on what exactly it is) could easily cause the error message noted by the OP.

You'd need to consult the C++ Standard itself to see why this might happen and what the correct behaviour is in this case, and I'm afraid I don't have my copy handy. I'm sure someone else must have a copy to look in though :-)

Anyway, until someone does, it may very will still be a bug, but if so then it's most likely this ambiguity in the syntax that has created the opportunity for it.

I suspect this is part of it ni can't seem to remember the proper syntax for prototypes wihout named vars.

Well things like

  int my_function(int);

are just fine, if it helps.  The names are entirely optional.

Kind regards,

Alastair.

--
http://alastairs-place.net



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >gcc 4.2 generates error that was OK before (From: Steve Mills <email@hidden>)
 >Re: gcc 4.2 generates error that was OK before (From: Alastair Houghton <email@hidden>)
 >Re: gcc 4.2 generates error that was OK before (From: Steve Mills <email@hidden>)
 >Re: gcc 4.2 generates error that was OK before (From: Markian Hlynka <email@hidden>)

  • Prev by Date: Re: gcc 4.2 generates error that was OK before
  • Next by Date: Re: gcc 4.2 generates error that was OK before
  • Previous by thread: Re: gcc 4.2 generates error that was OK before
  • Next by thread: Re: gcc 4.2 generates error that was OK before
  • Index(es):
    • Date
    • Thread