Skip to content

Commit 504dc86

Browse files
committed
fix: add -Wno-format to fix GCC builds
1 parent 6c258e4 commit 504dc86

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ env:
1010
COMMON_CFLAGS: >-
1111
-Wall
1212
-Werror
13+
-Wno-format
1314
-Wno-format-security
1415
-Wno-unused-but-set-variable
1516
-Wno-unused-const-variable

Justfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@ test:
2121
zig build test --summary all
2222

2323
test-valgrind:
24+
#!/usr/bin/env bash
2425
rm -f /tmp/runner*.fifo
2526
26-
clang -O3 example/main.c dist/core.c -I includes/ -o clang-main && ./clang-main
27+
export CFLAGS="-Wno-error=format -Wno-error=format-security -Wno-format -Wno-format-security"
28+
29+
clang $CFLAGS -O3 example/main.c dist/core.c -I includes/ -o clang-main && ./clang-main
2730
valgrind ./clang-main
2831
29-
gcc -O3 example/main.c dist/core.c -I includes/ -o gcc-main && ./gcc-main
32+
gcc $CFLAGS -O3 example/main.c dist/core.c -I includes/ -o gcc-main && ./gcc-main
3033
valgrind ./gcc-main
3134
3235
rm -rf clang-main gcc-main

src/runner_fifo.zig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ pub const PROTOCOL_VERSION: u64 = 2;
88

99
// Note: Using printf to avoid the extra code from std.log/std.debug. Those won't
1010
// compile because they are internally using syscalls (for Mutexes) which aren't cross-platform.
11+
//
12+
// We have to use c_char here, otherwise we redeclare it and cast u8 to char which results in
13+
// additional warnings (-Wbuiltin-declaration-mismatch and -Wpointer-sign).
1114
extern "c" fn printf(format: [*c]const c_char, ...) c_int;
1215

1316
pub const RunnerFifo = struct {

0 commit comments

Comments
 (0)