Skip to content
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

Bump -std to gnu11 for static assertions #817

Merged
merged 1 commit into from Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -94,7 +94,7 @@ endif()
set(JUDY_LIBRARIES "Judy")

# Standard FLAGS
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
if(NOT APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
endif()
Expand Down
2 changes: 1 addition & 1 deletion src/if-netmap-linux.c
Expand Up @@ -94,7 +94,7 @@ fetch_stats64(struct rtnl_link_stats64 *rtlstats64, char const *ifname, int nlrt
} err;
} u;
} nlresp;
_Static_assert(sizeof(nlresp.u.ans) >= sizeof(nlresp.u.err));
static_assert(sizeof(nlresp.u.ans) >= sizeof(nlresp.u.err), "ans is at least as large as err");
static const size_t ans_size = offsetof(struct nlresp, u.ans) + sizeof(nlresp.u.ans);
static const size_t err_size = offsetof(struct nlresp, u.err) + sizeof(nlresp.u.err);

Expand Down