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


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.


Unless I hear reasonable arguments against this, I will commit the patch
after 48 hours.

I don't think the above applies since the last time I checked, strace only works on Cygwin applications.


Cheers,
Nicholas


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