Web lists-archives.com

Re: Weird mismatch between cdefs and stdatomic




On 2019-01-30 00:15, LRN wrote:
> On 28.01.2019 17:02, LRN wrote:
>> This[0] and this[1]. One header checks for atomic C/CXX extensions *and* for
>> the presence of a C++ compiler, while the other only checks for extensions.
>> The result is that the _Atomic() macro is *not* defined in cdefs.h when
>> compiled with C++, but the stdatomic.h atomic macros assume that it is, and try
>> to access the "__val" struct member, with predictable and sad results.
>> I just stumbled upon this while compiling OpenSSL, and wanted to see if anyone
>> else encountered this problem.
> There is also a "!defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L"
> condition in cdefs.h that is not reproduced in stdatomic.h. So my initial guess
> seems to have been incorrect - it's not about C vs C++ compiler, it's about C11
> vs C99 compiler modes.

Search or man feature_test_macros or look at

	https://sourceforge.net/p/predef/wiki/Standards/

and for idiosyncracies

	https://sourceforge.net/p/predef/wiki/Compilers/

as of two years ago on the wiki; the downloads are six years old; for Windows see

	https://docs.microsoft.com/en-us/cpp/visual-cpp-language-conformance

as MS VC slowly moves towards C99 and C11 support for C++11 and C++14
conformance; details below

	https://social.msdn.microsoft.com/search/en-US/feed?query=conformance&rn=Visual%20C%2b%2b%20Team%20Blog&rq=site%3ahttps%3a%2f%2fblogs.msdn.microsoft.com%2fvcblog&format=RSS

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple