mingwex/getopt.c vs POSIXLY_CORRECT

Nicholas Wourms nwourms@netscape.net
Sun Feb 1 21:27:00 GMT 2004


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



More information about the Cygwin-apps mailing list