Re:C Posix complaint argument parsing in 42 loc, inspired by...
by kazinator on Friday January 06, 2023 @09:50AM
(#34275194)
I don't see the interpretation issue. The "parameters argc and argv" are the scalar, local variables. "argv array" is the object that "parameter argv" points to; it is not a parameter.
The modifiability of argv was the subject of at three items in 1998 in meeting n849.
Someone proposed that clarifying text be added saying "Whether or not the pointers of the argv array shall be modifiable by
the program is implementation-defined. If they are modifiable, they
shall retain their last-stored values between program startup and
program termination." This was rejected due to insufficient interest.
It was proposed that, since of course parameters are modifiable, the sentence in question be shortened to "The strings pointed to by the argv array shall be modifiable by the program, and retain their last-stored values between program startup and program termination", omitting the mention of "parameters argc and argv". This was discussed, but not accepted.
The question was raised whether the pointers are modifiable. Response was: "This is currently implictly unspecified and the committee
has chosen to leave it that way."
The modifiability of argv was the subject of at three items in 1998 in meeting n849.
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n849.htm
Someone proposed that clarifying text be added saying "Whether or not the pointers of the argv array shall be modifiable by the program is implementation-defined. If they are modifiable, they shall retain their last-stored values between program startup and program termination." This was rejected due to insufficient interest.
It was proposed that, since of course parameters are modifiable, the sentence in question be shortened to "The strings pointed to by the argv array shall be modifiable by the program, and retain their last-stored values between program startup and program termination", omitting the mention of "parameters argc and argv". This was discussed, but not accepted.
The question was raised whether the pointers are modifiable. Response was: "This is currently implictly unspecified and the committee has chosen to leave it that way."