On Tue, 19 Feb 2019, Martin Sebor wrote:

> Sure, the text is in a section named Program startup, but that doesn't
> imply that the constraints apply only at program startup.  If they did,

I think it's clear from the context that the section is describing the 
interface between the program and its environment, not the interface 
between a recursive caller of main and the so-called instance of main - 
that argc and argv there refer to the specific argc and argv objects for 
the initial call of main, not the different objects involved in any 
recursive call.  Furthermore, the statement that the parameters can be 
modified does not restrict such modifications to preserving the given 
properties (normal practice such as ++argv; --argc; would mean that there 
are sequence points at which those objects do not have the properties 
given).

> there would be no constraints on the parameters in any other calls to
> main, which would make the parameters unusable in general (because
> there is no way for main to tell if it's the fist invocation).

If a program chooses to call main recursively, presumably it has its own 
way to tell (e.g. some global variable the call to main can check).

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to