apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Hudson <ghud...@MIT.EDU>
Subject Re: [PATCH] apr_getopt_long interface update and interleaving support
Date Sat, 25 Nov 2000 00:35:16 GMT
>> -    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.

Mime
View raw message