tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [PATCH] pcictl: simplify its usage

(Resend, this time with the correct subject. I'm not subscribed
on tech-userlevel, so I c&p the mail from the archive.)

argv is passed through to getopt(). getopt() expects argv
as char * const [] or implicitely converts argv into this.

I tried const char *[] but this results in a warning when argv
is passed to getopt().

So either we go the "char * const []" way or leave it as is.
All other variants of const'ification produce a warning.


Christoph Egger wrote:
>-int   main(int, char *[]);
>+int   main(int, char * const []);

I am a bit confused by this.  To the best of my knowledge, there
is no const qualifier at any level of argv.  (I currently believe
that, strictly speaking, the pointers which are members of argv cannot be 
modified in strictly conforming code, but argv itself obviously can, and the 
characters pointed to by the members of
argv can.)

Home | Main Index | Thread Index | Old Index