You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In nxdk, we have been getting warnings when building libc++ about functions marked as noreturn supposedly returning. I have tracked this down to the function abort, which wasn't marked as noreturn when building C++ code. This is caused by the preprocessor code in _PDCLIB_internal.h (or _PDCLIB_aux.h in our case, we haven't rebased in a while), which relies on __STDC_VERSION__. Unfortunately, __STDC_VERSION__ is not defined in C++.
I checked how the compiler handles this, and it evaluates the __STDC_VERSION__ < 201112L condition to true, thereby not marking the functions as noreturn despite the compiler supporting it.
I replaced it with the following code, which fixes the warnings mentioned above:
I will make this change for now. I will have to think a bit about any effects that might arise from the PDCLib code being compiled with _Noreturn (or nothing at all), but then used with [[noreturn]]...
I will keep this open until I have had a good look at the implications of mixing _Noreturn and [[noreturn]], and at other instances of STDC_VERSION use. The immediate issue is resolved though.
In nxdk, we have been getting warnings when building libc++ about functions marked as
noreturn
supposedly returning. I have tracked this down to the functionabort
, which wasn't marked asnoreturn
when building C++ code. This is caused by the preprocessor code in_PDCLIB_internal.h
(or_PDCLIB_aux.h
in our case, we haven't rebased in a while), which relies on__STDC_VERSION__
. Unfortunately,__STDC_VERSION__
is not defined in C++.This is the problematic part:
I checked how the compiler handles this, and it evaluates the
__STDC_VERSION__ < 201112L
condition to true, thereby not marking the functions as noreturn despite the compiler supporting it.I replaced it with the following code, which fixes the warnings mentioned above:
There are other uses of
__STD_VERSION__
in PDCLib that might need similar treatment.The text was updated successfully, but these errors were encountered: