This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin 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]

Re: mingwex/getopt.c vs POSIXLY_CORRECT


Nicholas Wourms wrote:
danny_r_smith wrote:

Hello

This is a mingw issue, but effects cygwin -mno-cygwin apps (probably
setup) too so I cross-post to see what antipathy (a new word: as in
"antipathy rules, OK") I raise.

The cygwin implementation of getopt and getopt_long effectively defaults
to POSIXLY_CORRECTness by virtue of: #define IS_POSIXLY_CORRECT (getenv("POSIXLY_INCORRECT_GETOPT") == NULL)


Now, that environmental variable is bit strange to me, particularly in a
native environment such as mingw that doesn't have a clue about PC, I
propose this patch, for mingw subdir, so that the default implementation
of mingw's getopt matches the documentation in NetBSD man page. In
effect this means that the permute and in_order BSD extensions (the
latter also a default GNUC extension) are enabled for mingw.


According to Chuck, this was only done because the default behaviour broke strace under Cygwin.


strace (and ssp) could be trivially fixed with a one character patch.


FWIW, I recently went through the entire archive of Cygwin mailing lists researching why this change was made. An analysis, my conclusions and a few patches (that have thus far been completely ignored) are here:

http://sources.redhat.com/ml/cygwin-patches/2003-q4/msg00223.html

Cheers


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