Skip to content

build: pin -std=c11 for instrument-hooks core.c#84

Merged
not-matthias merged 1 commit into
mainfrom
cod-2953-use-stdc11-for-instrument-hooks-in-integrations
Jun 24, 2026
Merged

build: pin -std=c11 for instrument-hooks core.c#84
not-matthias merged 1 commit into
mainfrom
cod-2953-use-stdc11-for-instrument-hooks-in-integrations

Conversation

@not-matthias

Copy link
Copy Markdown
Member

No description provided.

@codspeed-hq

codspeed-hq Bot commented Jun 22, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
❌ 7 regressed benchmarks
✅ 230 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime switch 1 144 ns 168 ns -14.29%
WallTime short body 2.3 µs 2.7 µs -13.57%
WallTime switch 2 156 ns 180 ns -13.33%
WallTime short body 2.5 µs 2.8 µs -12.29%
WallTime short body 2.4 µs 2.7 µs -11.79%
WallTime test sync baz 10 192 ns 216 ns -11.11%
WallTime short body 2.3 µs 2.6 µs -10.6%
Memory wait 500ms 71 KB 64.1 KB +10.79%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing cod-2953-use-stdc11-for-instrument-hooks-in-integrations (1999ec9) with main (56fa9fc)

Open in CodSpeed

@not-matthias not-matthias marked this pull request as ready for review June 22, 2026 12:14
@greptile-apps

greptile-apps Bot commented Jun 22, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds -std=c11 to the cflags_c key in binding.gyp to explicitly pin the C language standard when compiling instrument-hooks' core.c. Using cflags_c (rather than cflags) correctly scopes the flag to C-only translation units, avoiding any conflict with the C++ source files in the same target.

  • Adds "cflags_c": ["-std=c11"] to the native_core target in binding.gyp so that core.c (the only C file in sources) is compiled under an explicit C11 dialect on Linux.
  • The change does not touch xcode_settings.OTHER_CFLAGS, which is the macOS-side equivalent; modern Apple Clang defaults to C17 or newer so macOS builds should be unaffected.

Confidence Score: 5/5

Minimal one-liner change that correctly pins the C11 standard only for C source files; no logic or interface changes.

The change is a single targeted build-flag addition to cflags_c, which is the right key for C-only compilation flags in node-gyp. It does not touch any runtime logic, exported APIs, or test code, and the scoping prevents accidental side-effects on the C++ translation units in the same target.

No files require special attention.

Important Files Changed

Filename Overview
packages/core/binding.gyp Adds cflags_c: ["-std=c11"] to pin the C standard for core.c; placement and scoping are correct.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[binding.gyp: native_core target] --> B{Source file type}
    B -->|.cc files| C[cflags_cc - C++ flags]
    B -->|.c file - core.c| D[cflags_c - C-only flags - std=c11 NEW]
    B -->|Both .c and .cc| E[cflags - Shared flags]
    D --> F[core.c compiled with C11 standard]
    C --> G[C++ files compiled without C standard flag]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[binding.gyp: native_core target] --> B{Source file type}
    B -->|.cc files| C[cflags_cc - C++ flags]
    B -->|.c file - core.c| D[cflags_c - C-only flags - std=c11 NEW]
    B -->|Both .c and .cc| E[cflags - Shared flags]
    D --> F[core.c compiled with C11 standard]
    C --> G[C++ files compiled without C standard flag]
Loading

Reviews (2): Last reviewed commit: "build: pin -std=c11 for instrument-hooks..." | Re-trigger Greptile

The Zig-generated dist/core.c is rejected under C23 (GCC 15's default),
so pin C11 via cflags_c (C-only, so the C++ sources are unaffected).
@not-matthias not-matthias force-pushed the cod-2953-use-stdc11-for-instrument-hooks-in-integrations branch from 0b9689b to 1999ec9 Compare June 24, 2026 09:53
@not-matthias not-matthias merged commit 1999ec9 into main Jun 24, 2026
30 of 31 checks passed
@not-matthias not-matthias deleted the cod-2953-use-stdc11-for-instrument-hooks-in-integrations branch June 24, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants