Xxhash: Can't compile with MSVC when /std:c11 used

Created on 4 Jan 2021  路  2Comments  路  Source: Cyan4973/xxHash

MSVC recently included support for C11 and C17, the problem of course is that they half-assed it and there's no . It seems like reordering macros so that if defined(_MSC_VER) would precede #elif defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11+ */ would help.

Most helpful comment

Good points. Turns out that despite Visual Studio 16.8 (a stable version) offering the option to compile as C11 or C17 we still need to have the insider version of the SDK in order to find everything we need to compile as C11/C17. So you're right, it's just a transitional problem and there's no need to do anything about it.

All 2 comments

That's surprising,
I thought that <stdalign.h> was part of the _mandatory_ section of C11, hence not optional.

It seems to be confirmed on this old Microsoft devblogs:
https://devblogs.microsoft.com/cppblog/c11-and-c17-standard-support-arriving-in-msvc/

So, it begs the question, what happened ?

The proposed fix is simple and likely effective,
I just want to be sure that we are doing the "right thing" here,
which is, use the standard when it's applicable, then use local specific interface when standard is not available.
We don't want to jump too fast to conclusions if the issue is transitional in a preview release.

Good points. Turns out that despite Visual Studio 16.8 (a stable version) offering the option to compile as C11 or C17 we still need to have the insider version of the SDK in order to find everything we need to compile as C11/C17. So you're right, it's just a transitional problem and there's no need to do anything about it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gitmko0 picture gitmko0  路  4Comments

shuffle2 picture shuffle2  路  6Comments

hiqbn picture hiqbn  路  7Comments

gitmko0 picture gitmko0  路  7Comments

jvriezen picture jvriezen  路  6Comments