[ub] What does "The function main shall not be used within a program" mean?

Stephen Clamage stephen.clamage at oracle.com
Wed Jan 22 08:13:44 CET 2014


On 1/21/2014 17:57, David Krauss wrote:
> On Jan 22, 2014, at 9:08 AM, Stephen Clamage <stephen.clamage at oracle.com> wrote:
>
>> If you could declare
> Is the intent to prohibit forward declaration? This would seem to be the difference between use and ODR-use in the original question.
>
I thought I remembered an explicit prohibition against declaring main, but I 
don't find it in any issues of the C++ standard, C++98, 03, 11, or the C++14 
draft.


On 1/21/2014 22:13, Ville Voutilainen wrote:
 > I don't want a recursive main. I want such shenanigans to be ill-formed.
 > Implementations don't seem to agree, and I want to know whether
 > our current wording intends such things to be ill-formed or UB.


All issues of the standard explicitly forbid calling main recursively, in 5.2.2/9.

- Steve


More information about the ub mailing list