Compiler lacks support for C11 static assertions
Posted: 2025-04-21 14:31
root@WJHWPC:/home# arm-rockchip830-linux-uclibcgnueabihf-gcc test.c
In file included from test.c:2:
test.c:17:15: error: expected declaration specifiers or '...' before '__builtin_offsetof'
static_assert(offsetof(struct Foo, a) == 0, "First element of struct does not have offset 0");
^~~~~~~~
test.c:17:45: error: expected declaration specifiers or '...' before string constant
static_assert(offsetof(struct Foo, a) == 0, "First element of struct does not have offset 0");
arm-rockchip830-linux-uclibcgnueabihf-gcc lacks support for C11 static assertions.
交叉编译工具不支持C11,怎么办?
In file included from test.c:2:
test.c:17:15: error: expected declaration specifiers or '...' before '__builtin_offsetof'
static_assert(offsetof(struct Foo, a) == 0, "First element of struct does not have offset 0");
^~~~~~~~
test.c:17:45: error: expected declaration specifiers or '...' before string constant
static_assert(offsetof(struct Foo, a) == 0, "First element of struct does not have offset 0");
arm-rockchip830-linux-uclibcgnueabihf-gcc lacks support for C11 static assertions.
交叉编译工具不支持C11,怎么办?