Hi,
" > " this approach either, I'd suggest to let gengetopt
" generate "optind =
" > " 0" instead of "optind = 1".
"
" > Let's see what the specs says [IEEE Std 1003.1, 2004 Edition
" > http://www.opengroup.org/onlinepubs/009695399/functions/optind.html]
" >
" > "The variable optind is the index of the next element of the argv[]
" > vector to be processed. It shall be initialized to 1 by the system,
"
" I think the word "system" in this sentence refers to the underlying
" library that _implements_ getopt (e.g. glibc), rather than to the
" application that _uses_ it. Indeed, glibc's posix/getopt.c sets this
You may right, and moreover I must admit that I'm able to change this issue in the library itself.
However, the term "system" is quite ambiguous at least without the original context, I
think the system could be interpreted as a whole which means none of the components (the getopt
implementation, the library calling getopt, and the application itself) should not set optind to 0,
because the sentence continues like this: "... and getopt() shall update it when ...".
Note the different subjective: system vs. getopt(). But I may be wrong.
I just wanted to attract the attention to the possible negative(?) outcomes of
this change.