This is the mail archive of the
glibc-bugs@sources.redhat.com
mailing list for the glibc project.
[Bug libc/397] New: getopt should not reorder argv
- From: "nick at usenix dot org" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 21 Sep 2004 18:58:22 -0000
- Subject: [Bug libc/397] New: getopt should not reorder argv
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
The function prototype for getopt is
int getopt(int argc, char * const argv[], const char *optstring);
which says that argv is an array of const pointer to char. However, if PERMUTE
ordering is in effect, argv is altered (and is therefore abusing the "const"
requirement). The manual suggests that this function has a different prototype
than that in <getopt.h>, without the const. POSIX defines getopt with the const
(but forbids permute behavior).
I think the only viable solution here is to remove the const ... as much as I
hate the idea.
--
Summary: getopt should not reorder argv
Product: glibc
Version: 2.3.3
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: gotom at debian dot or dot jp
ReportedBy: nick at usenix dot org
CC: glibc-bugs at sources dot redhat dot com
GCC build triplet: i386-redhat-linux
GCC host triplet: i386-redhat-linux
GCC target triplet: i386-redhat-linux
http://sources.redhat.com/bugzilla/show_bug.cgi?id=397
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.