This is the mail archive of the glibc-bugs@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/397] New: getopt should not reorder argv


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]