Skip to content

Commit 1d6f615

Browse files
committed
build: pin -std=c11 for instrument-hooks core.c
The Zig-generated dist/core.c is rejected under C23 (GCC 15's default), so pin C11 in both the Bazel and CMake builds.
1 parent e47ecff commit 1d6f615

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

core/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ cc_library(
6666
copts = select({
6767
":windows_strict_warnings": ["/W4","/WX"] + instrument_hooks_cflags_windows,
6868
":windows": instrument_hooks_cflags_windows,
69-
":strict_warnings_enabled": ["-Wall", "-Werror"] + instrument_hooks_cflags,
70-
"//conditions:default": instrument_hooks_cflags,
69+
":strict_warnings_enabled": ["-std=c11", "-Wall", "-Werror"] + instrument_hooks_cflags,
70+
"//conditions:default": ["-std=c11"] + instrument_hooks_cflags,
7171
}),
7272
visibility = ["//visibility:public"],
7373
)

core/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ set(instrument_hooks_SOURCE_DIR ${instrument_hooks_repo_SOURCE_DIR})
2727
# Add the instrument_hooks library
2828
add_library(instrument_hooks STATIC ${instrument_hooks_SOURCE_DIR}/dist/core.c)
2929

30+
# Pin C11: the Zig-generated core.c is rejected under C23 (e.g. GCC 15's default),
31+
# which mangles [[noreturn]] placement in the embedded zig.h.
32+
set_target_properties(
33+
instrument_hooks
34+
PROPERTIES C_STANDARD 11 C_STANDARD_REQUIRED ON
35+
)
36+
3037
target_include_directories(
3138
instrument_hooks
3239
PUBLIC

0 commit comments

Comments
 (0)