This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Can argv be NULL in C?


On Fri, Oct 7, 2016 at 6:27 PM, Martin Sebor <msebor@gmail.com> wrote:
>
> Right.  In a hosted environment argv must not be null.  It's
> up to the implementation to guarantee that for all conforming
> programs.  If a program is non-conforming (e.g., it calls exceve
> or its equivalent to start a program with a null argv) it's still
> up to the implementation to decide what to do with it (it could
> simply punt and pass the null through or it could substitute
> an array of pointers for it with the first one set to null).
>

Thanks for your answer, Martin.  Looks like the argv can be NULL
in reality.

-- 
Yao (齐尧)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]