Web lists-archives.com

Re: [Mingw-users] Does MinGW not support -std=c++11 flag?




-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 17/10/16 20:05, DAVENPORT, MARC wrote:
[concerning partial inclusion guard logic in <wchar.h>]
> I don't quite understand the logic of the line you used to fix the 
> inclusion though (The comment confuses me) :

Inverse logic does tend to be confusing, especially when combining
negated conditions.  I've tried to make it clearer, in the published
version, but basically the guarded code is always exposed the first
time that part of <wchar.h> is read, but not if it is read a second
time.  For it to be read a second time, its first time *must* have
been as a result of partial inclusion by <string.h>, which results
in _STRING_H being defined, so if *both* _WCHAR_H and _STRING_H are
defined:

  #if defined _WCHAR_H && defined _STRING_H

then it is implicit that this is the second time of reading.  However,
if __STRICT_ANSI__ is defined, then the partial inclusion of <wchar.h>
by <string.h> is suppressed, so _STRING_H may be defined *without* the
assumed first reading of this code having occurred.  Thus, to identify
this case we need to check for the qualified sub-expression:

  #if defined _STRING_H && ! defined __STRICT_ANSI__

or, combining the two sub-expressions to identify a second reading:

  #if  defined _WCHAR_H \
   && (defined _STRING_H && ! defined __STRICT_ANSI__)

Finally, we need to invert the logic, to *exclude* the guarded code on
second reading, so we end up with[*]:

  #if ! (defined _WCHAR_H \
   &&   (defined _STRING_H && ! defined __STRICT_ANSI__))

[*]: Yes, I know there are more parentheses there than may be strictly
necessary; IMO, they should help to clarify the logical intent for the
benefit of human readers.

- -- 
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)

iQIcBAEBAgAGBQJYBohsAAoJEMCtNsY0flo/uJoP/25UD29uueT4C2GGUf7nzO/n
ASvV++Ll6XRk/eMg39qz1QkpXMdHw0PxJse+C1OnomfV4Z0jj+XsTGxDWSDNPrtp
sr3wK1lAG/EZOYXSDWlhwhgdawLCqpL22Q4OhSrcB5El9koWen97ka+n1M7DCuIP
qbvKN2PP9nNlUbOM7MZurqqflwMzH27eaU2kdBOX1p5+wizcV8PryDL1UIDf3K4t
xcb+4tjEgSHJxOfxampak1hUMtLTi1Qjku1dLdadEZpJKJgsRl3HEdfCSOP0PN41
4eYcJxUNnuPr0yoQu9AZaS00o0JFFqNOnNXm4qYsiTpkDhfl3Ou8DnJQi6hKYrRQ
/3QwVC2Z5SKWwjGcKIkF1TNxXLJe96yBIy4Zm01KaXWk90xveNppQBIeL/k1wxOo
/VqiPgmERcYwYOUYxxNH1M+Y0BWnTPrmvkPy497lUzs3Uw7G4aKMh5VHUjnIJwLu
3iVYWCLZjWVUdUyGhTALToXZ20D/p/ICya6af2u13iRs45Q73w+Vg96tD/Koh+pL
rEIOFoYEVgSxFsidsOtGr9hsViRMX9eSTm4Pl9Cz9DmBFvGEH4m8RtKCAyEWmlvt
0yTRzVUV4WDz2HpvfKIIRXp+FTDJY8jI5kfzAzZ0iVJMjWgOplXuv59VvlZF0xGZ
0/p8PIyZhvy9sB12lOXi
=K/+h
-----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-users@xxxxxxxxxxxxxxxxxxxxx

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-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe