[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] apr_getopt_long interface update and interleaving support

From: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2000-11-25 01:35:16 CET

>> - char *const *argv;
>> + char **argv;

> Um. I don't think we can do this with argv. I'm surprised that it
> isn't "const char * const * argv".

We can do whatever we want with argv. That's pretty well-established.

It wasn't "const char *const *argv" before because a "char **"
argument is not compatible with such a parameter, and C programs
canonically take "char **argv", not "const char *const *argv". I'm
not sure if it's even valid C to silently change from char * to const
char * without an explicit cast, which is what you'd be doing if you
wrote a main() which accepted a list of const char pointers intead of
a list of char pointers.

(Branko said this as well, in different words.)

> Certainly, if we make a copy of the array (of pointers), then we
> could have "const char **argv" and that would allow us to permute.

I can do this if you think it's important, but the gnu getopt_long
certainly doesn't bother.

> I think the name "apr_option_t" is a bit too generic. The
> apr_getopt_ prefix probably ought to remain.

Okay, will resubmit with that change.
Received on Sat Oct 21 14:36:15 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.