[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1573106 - /subversion/trunk/build/ac-macros/compiler.m4

From: Branko Čibej <brane_at_wandisco.com>
Date: Sat, 01 Mar 2014 12:38:30 +0100

On 01.03.2014 11:05, Philip Martin wrote:
> Branko Čibej <brane_at_wandisco.com> writes:
>
>> On 28.02.2014 23:57, philip_at_apache.org wrote:
>>> Author: philip
>>> Date: Fri Feb 28 22:57:24 2014
>>> New Revision: 1573106
>>>
>>> + AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(){return 0;}]])]
>> This bit of source is not valid C90. It should be: int main(void){ ... }
> I don't have a copy of the C90 standard but 'int main()' is used in some
> of the examples in both the C99 and C++98 standards.

Yes, the semantics changed in C++, where name() means the same as
name(void) in C90. The semantics in C99 are the same as in C90; name()
means that the function is variadic and takes any number of arguments.
However, the 'main' function is explicitly defined to have exactly two
forms:

    int main(void); // or int main(); in C++

and

    int main(int argc, char *argv[]);

The distinction is unimportant as far as the purpose of he configure
test is concerned; but a pedantic compiler may warn, or even refuse to
accept, the form you use in the test.

(FWIW, in C++, you don't need an explicit return statement in 'main',
either; running past the end of the function implies an implicit 'return
0;')

-- Brane

-- 
Branko Čibej | Director of Subversion
WANdisco // Non-Stop Data
e. brane_at_wandisco.com
Received on 2014-03-01 12:39:10 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.