-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider testing __STDC_VERSION__ >= 202000L in avif.h for C compiler's [[nodiscard]] support #2352
Comments
This test program prints the value of
For GCC and Clang, we can use the command |
According to the standard, (cf https://open-std.org/JTC1/SC22/WG14/www/docs/n3220.pdf , look for the string |
The
[[nodiscard]]
attribute will be added to C23. That's why we are testing__STDC_VERSION__ >= 202311L
in avif.h.Experiments showed that if we pass the
-std=c2x
or-std=gnu2x
option to recent versions of GCC and Clang (including Apple Clang), the__STDC_VERSION__
macro is defined as202000L
. So we may want to change the__STDC_VERSION__ >= 202311L
test to__STDC_VERSION__ >= 202000L
in avif.h.Note: If we pass the
/std:clatest
option to MSVC,__STDC_VERSION__
macro is defined as202312L
.The text was updated successfully, but these errors were encountered: