https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53769

Christophe Monat <christophe.monat at st dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |christophe.monat at st dot com

--- Comment #10 from Christophe Monat <christophe.monat at st dot com> ---
Now that C11 is complete, would it be acceptable to have GCC define
__STDC_NO_THREADS__ and __STDC_NO_ATOMIC__ when appropriate ?

Beyond the standard that stipulates this behavior, IAR compilers do provide
these definitions - at least according to their documentation (IAR C/C++
Development Guide Compiling and Linking - ARM version - 2019). I have not
checked other commercial compilers.

This would avoid this behavior of the ARM embedded toolchain:

$ cat samples-threads.c
#if !defined(__STDC_NO_THREADS__)
#include <threads.h>
#endif

$ gcc-arm-none-eabi-8-2019-q3-update/bin/arm-none-eabi-gcc  samples-threads.c
In file included from samples-threads.c:2:
/sw/FROM_sw_st_gnu_compil_comp/comp/arm/linaro/gcc-arm-none-eabi-8-2019-q3-update/arm-none-eabi/include/threads.h:30:10:
fatal error: machine/_threads.h: No such file or directory
 #include <machine/_threads.h>
          ^~~~~~~~~~~~~~~~~~~~

Reply via email to