1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

core/xfa: make const XFA's volatile

This prevents gcc from figuring out that an XFA that has been
initialized in the same file is technically empty when the compilation
unit is seen by itself. This happened with gcc 10.1.0 on msp430-elf.
This commit is contained in:
Kaspar Schleiser 2020-12-01 11:14:56 +01:00
parent 6711388afe
commit 50dc68bd21

View File

@ -58,8 +58,8 @@ _Pragma("GCC diagnostic ignored \"-Warray-bounds\"")
#define XFA_INIT_CONST(type, name) \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wpedantic\"") \
_XFA_CONST(name, 0_) const type name [0] = {}; \
_XFA_CONST(name, 9_) const type name ## _end [0] = {}; \
_XFA_CONST(name, 0_) const volatile type name [0] = {}; \
_XFA_CONST(name, 9_) const volatile type name ## _end [0] = {}; \
_Pragma("GCC diagnostic pop") \
extern const unsigned __xfa_dummy