fix: instrument-hooks build failure on preview runner#65
Conversation
Merging this PR will not alter performance
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| 🆕 | BenchmarkFibonacciDarwin |
N/A | 250.8 µs | N/A |
Comparing cod-2942-go-runner-fails-to-compile-instrument-hooks-generated-c-on (c102c1a) with main (f6291c8)
Footnotes
-
1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports. ↩
9928014 to
50282b0
Compare
Greptile SummaryThis PR fixes a build failure for
Confidence Score: 4/5Safe to merge — the CFLAGS change fixes a real build failure and the CI cleanup is straightforward. The core change is small and targeted: adding -std=c11 to the cgo CFLAGS so the embedded core.c is compiled with an explicit C standard. The only open question is whether strict c11 (no GNU extensions) vs gnu11 (C11 + GNU extensions) is the right dialect, given that -Wno-incompatible-pointer-types hints at non-standard pointer usage in core.c. If core.c relies on any GNU-only constructs, a future compiler or platform change could surface a failure that gnu11 would have avoided. The CI change — dropping the branch-pinned runner workaround — is unambiguously correct. go-runner/overlay/instrument-hooks.go warrants a second look on the choice of -std=c11 vs -std=gnu11. Important Files Changed
|
|
|
||
| /* | ||
| #cgo CFLAGS: -I@@INSTRUMENT_HOOKS_DIR@@/includes -Wno-format -Wno-format-security -Wno-incompatible-pointer-types | ||
| #cgo CFLAGS: -std=c11 -I@@INSTRUMENT_HOOKS_DIR@@/includes -Wno-format -Wno-format-security -Wno-incompatible-pointer-types |
There was a problem hiding this comment.
-std=c11 enables C11 but disables GNU language extensions (e.g. __attribute__ extensions, statement expressions, nested functions). The already-present -Wno-incompatible-pointer-types suggests core.c is not fully standards-clean, so there is a latent risk that code which compiles now under the platform's default dialect (gnu17 on recent GCC, gnu17 on Apple Clang) would fail if any GNU-only construct is reached. -std=gnu11 gives you all of C11 while keeping GNU extensions available — if the root cause of the preview-runner failure was the compiler defaulting below C11, gnu11 would fix it equally and leave less room for future breakage.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
No description provided.