[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 1/4] config.guess: Avoid implicit int in definitions of ma
From: |
Dmitry V. Levin |
Subject: |
Re: [PATCH v2 1/4] config.guess: Avoid implicit int in definitions of main. |
Date: |
Sun, 28 Jul 2024 16:15:52 +0300 |
On Mon, May 13, 2024 at 04:55:28PM -0400, Zack Weinberg wrote:
> From: Petr Vorel <petr.vorel@gmail.com>
>
> Implicit ‘int’ (e.g. ‘extern foo();’ meaning the same thing as
> ‘extern int foo();’) was dropped from the C standard in its 1999
> edition. Twenty-five years later, free C compilers are finally
> starting to make this an error by default, so let’s not use it
> anymore in config.guess probe programs.
>
> (Note: As of this writing, GCC 14 and Clang 16 are both more lenient
> for ‘main() { … }’ specifically than for other uses of implicit int.
> Still, the writing is clearly on the wall.)
>
> We continue to use ‘int main() { … }’, instead of ‘int main(void) { … }’,
> because these programs may be compiled by truly ancient compilers that
> do not recognize the keyword ‘void’. This leaves open the possibility
> of a compiler that errors by default on an empty argument list in a
> function definition, which, prior to the 2024 C standard, is technically
> still an “old-style” function definition; but we can worry about that
> if and when it comes up.
>
> Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
> Co-authored-by: Zack Weinberg <zack@owlfolio.org>
Applied, thanks.
--
ldv
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH v2 1/4] config.guess: Avoid implicit int in definitions of main.,
Dmitry V. Levin <=