Re: [PATCH] AC_LANG_INT_SAVE: Modernize function declarators (C89 and above).

Vincent Lefevre <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.patches
Message-ID <[email protected]>
On 2020-08-06 18:50:33 -0700, Paul Eggert wrote:
> For what it's worth, I count 13 instances of 'int main (void) { ... }' in
> Gnulib code, and 136 instances of 'int main () { ... }'. As I recall, the
> latter is for C++ compatibility, which I guess is not an issue with MPFR.

I don't understand what you mean. The program

int main(void)
{
  return 0;
}

compiles fine with g++, even using "-std=c++17 -pedantic".

Note also that when testing MPFR, we also test it with g++.
MPFR has also been tested with MSVC.

As many test programs of MPFR use "int main(void)", if there were
an issue with this, I assume that this would have been detected.

-- 
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.