Re: gcc 4.2 generates error that was OK before
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