Discussion:
[Mingw-users] Possible error in _mingw.h
Anton Shepelev
2017-04-16 11:11:50 UTC
Permalink
Hello, all

It seems that _mingw.h wrongly assumes that the
macro _XOPEN_SOURCE always expands into a non-emptry
string:

#if (_XOPEN_SOURCE) >= 500

Bryan Henderson, the author of Netpbm, have suggest-
ed the following fix:

#if (_XOPEN_SOURCE + 0) >= 500
--
Please, do not forward replies to my e-mail.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
MinGW-users mailing list
MinGW-***@lists.sourceforge.net

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-***@lists.sourceforge.net?subject=unsubscribe
Keith Marshall
2017-04-16 19:43:43 UTC
Permalink
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
It seems that _mingw.h wrongly assumes that the macro _XOPEN_SOURCE
Nope. Usage in <_mingw.h> is correct; for POSIX.1-2008:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html
| The _XOPEN_SOURCE Feature Test Macro
|
| An XSI-conforming application shall ensure that the feature test
| macro _XOPEN_SOURCE is defined with the value 700 before inclusion of
| any header. This is needed to enable the functionality described in
| The _POSIX_C_SOURCE Feature Test Macro and to ensure that the XSI
| option is enabled.

The value of 700 is specific to Issue 7 of POSIX.1 (POSIX.1-2008);
lesser values are applicable for earlier versions of the standard,
but in _every_ case, the application is _required_ to specify the
_XOPEN_SOURCE value for which conformance is desired.
#if (_XOPEN_SOURCE) >= 500
Where do you see that? Nowhere in <_mingw.h> do I see that particular
test; I _do_ see:

#if _XOPEN_SOURCE < 500

(among other similar tests, but _never_ with _XOPEN_SOURCE specified
in parentheses ... not that it really matters, if _XOPEN_SOURCE is
properly defined, as POSIX.1 stipulates).
Bryan Henderson, the author of Netpbm, have suggested the following
#if (_XOPEN_SOURCE + 0) >= 500
Bryan Henderson should correct the improper usage in Netpbm, (assuming
that this is where you are encountering the issue).

- --
Regards,
Keith.

Public key available from keys.gnupg.net
Key fingerprint: C19E C018 1547 DE50 E1D4 8F53 C0AD 36C6 347E 5A3F
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)

iQIcBAEBAgAGBQJY88lvAAoJEMCtNsY0flo/1nwP/A2PCV54hai47jWo2UowQ42D
iARDtRPiubo0POYGH7jPRCh9As0D+EM4HQYJ8nhSdhbuyucyrJSlRgqFkXD3lPCB
XzIV91+vTx0Km2oomJxq2RldUSLhGUfxbIeyexSNw+JI65Fs91FssW+k7MnweA9L
9k9PuKRfH8w+uKSNwX+b3XvPtWkX1W1QZitXFeiH+3i1gynaie4Au7PGYorK42Kf
/Tm35wUKHtuMr7Uh5D+L5TehWEmXkPeSm+BeQ4vPuC54Wme3JYioa7GR6Ynu7pz/
yIldfON2GinxFdUhA11FHJ5GdGZpwN01N6cJpcBrzI9i5b+mo/YBZp4liGtYNEAU
LwNNuustCph5SE41VQacNDt+o67UAI3EItfJ5fjCsuJM1dlgzlrf9aSWukCGjePl
j+fVE3NgvXXah6dZmXr+kf1WR4vIsWbFW6TMnR7hAxzFsFokzpDwpti80IuZU6u6
aWTt0GY8XZAffcRo8Su3BWJyKwtejToE8WlvgFHNx+sW8tquX31KiuMfWi8WOuch
VaBrpxzN7wzHC+J0nfSGvio9nCzQ6f4DF4COz2pip3W2YPmkwP2bNRFnBX9TtUci
OVOEgIQEqZk7XJZdg2MNDN4cdguP53My6BlkoB65pKHG9m9OzjpoZdMd6UCo3sw6
iqk1+eYjNNGYj1fvpWrH
=o7UJ
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
MinGW-users mailing list
MinGW-***@lists.sourceforge.net

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-***@lists.sourceforge.net?subject=unsubscribe
Anton Shepelev
2017-04-20 19:15:28 UTC
Permalink
Post by Keith Marshall
It seems that _mingw.h wrongly assumes that the
macro _XOPEN_SOURCE always expands into a non-
#if (_XOPEN_SOURCE) >= 500
Bryan Henderson, the author of Netpbm, have sug-
#if (_XOPEN_SOURCE + 0) >= 500
Where do you see that? Nowhere in <_mingw.h> do I
see that particular test
I quoted Bryan as a general example of his fix. I
should have either written so or quoted actual MinGW
code. Beg your pardon.
--
Please, do not forward replies to my e-mail.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
MinGW-users mailing list
MinGW-***@lists.sourceforge.net

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-***@lists.sourceforge.net?subject=unsubscribe
Continue reading on narkive:
Loading...