C++ Logo

std-proposals

Advanced search

Re: [std-proposals] D3803R0 More standard forms of main

From: Thiago Macieira <thiago_at_[hidden]>
Date: Wed, 23 Jul 2025 07:48:21 -0700
On Tuesday, 22 July 2025 12:53:07 Pacific Daylight Time Paul Caprioli via Std-
Proposals wrote:
> I specifically mentioned "not supported by older compilers" because this
> proposal seeks to standardize existing practice and, "At the time of
> writing, MSVC accepts void main() without warnings, EDG accepts void main()
> with warnings, and GCC and Clang reject this declaration."
>
> If "void main()" is proposed as a new feature, what problem is it trying to
> solve?

GCC still accepts the implicit-int main(), I guess for compatibility with B?

https://gcc.godbolt.org/z/s3GaTs9cb

The above program compiles with GCC as C++11, C89 and would have compiled as B
if GCC supported it, except that the return statement was "retrn" because I
guess Kernigham hated vowels... (q.v. "creat")

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Platform & System Engineering

Received on 2025-07-23 14:48:27