Re: main() vs getopt() signature mismatch
Re: main() vs getopt() signature mismatch
- Subject: Re: main() vs getopt() signature mismatch
- From: Jean-Daniel Dupas <email@hidden>
- Date: Sat, 26 Oct 2013 00:48:17 +0200
Le 25 oct. 2013 à 18:54, Todd Heberlein <email@hidden> a écrit :
>
> On Oct 24, 2013, at 11:51 PM, Jean-Daniel Dupas <email@hidden> wrote:
>
>> What about changing main to "int main(int argc, char *argv[])" as defined in the C standard (section 5.1.2.2.1) ?
>
> Interesting. When creating a new command line tool in Xcode, main.cpp begins
>
> int main(int argc, const char * argv[])
>
> I looked around to see if C++11 changed this, but I haven’t found anything yet. I wonder why Apple adds the “const” if it isn’t part of the standard?
>
C++ standard defines it in section 3.6.1 ( 3.6 Start and termination [basic.start] / 3.6.1 Main function )
It tells the "main" type is implementation defined but that
“All implementations shall allow both
— a function of () returning int and
— a function of (int, pointer to pointer to char) returning int”
-- Jean-Daniel
_______________________________________________
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