Skip to content

Commit

Permalink
Bump -std to gnu11 for static assertions (#817)
Browse files Browse the repository at this point in the history
  • Loading branch information
droe committed Mar 10, 2024
1 parent 8a2583d commit afbeb0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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

0 comments on commit afbeb0b

Please sign in to comment.