On 02.03.2014 03:56, Philip Martin wrote:
> Branko Čibej <brane_at_wandisco.com> writes:
>
>> On 02.03.2014 03:15, Philip Martin wrote:
>>> I have no problem with your change but I don't believe a compiler would
>>> reject 'int main()'. The standard explicitly allows declarations
>>> "equivalent" to the two declarations you give and I believe 'int main()'
>>> qualifies, particularly since some of the examples in the standard use
>>> 'int main()'.
>> The standard allows the compiler to accept other, implementation-defined
>> signatures, but it does not require it to accept them. That's not the
>> same as allowing equivalent declarations. A compiler is perfectly free
>> to raise an error if it sees main defined in anything except the two
>> forms explicitly mentioned in the standard.
> "implementation-defined" is distinct from "equivalent".
>
> 5.1.2.2.1
>
> "It shall be defined with ...
>
> or with ...
>
> or equivalent; or in some implementation-defined manner."
>
> So an "equivalent" definition to the two is required to be accepted.
> Now we could quibble about what exactly is "equivalent" but anything
> that is has to be accepted.
"int main(void)" is not equivalent to "int main()" in C; it is in C++.
--
Branko Čibej | Director of Subversion
WANdisco // Non-Stop Data
e. brane_at_wandisco.com
Received on 2014-03-02 12:36:12 CET