You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Two c_imports whose headers #define the same macro: "failed to compile C header snippet" for the second #1753
Spec: §16.2 (c_import), §18.2 (D70: a use c_import(...) is an import; the later import shadows the earlier).
Repro (installed main, and branch ruled-fixes):
a.h: #define PI 3 b.h: #define PI 4
use c_import("a.h")
use c_import("b.h")
fn main:
print(PI)
Actual:error: failed to compile C header snippet: b.h at the end of the file. Each header alone works (b.h alone prints 4).
Expected: both import; under D70 bare PI is b.h's (the later import) and a.PI / b.PI reach each (the namespaces landed on ruled-fixes). The cross-c_import dedup (ci_mark_cached_names) is the likely suspect: the second translation of a name the first already produced fails instead of producing the header's own value.
Found while writing D70 tests; the tests use one header and std.math instead.
Activity
c_import: two headers that define one macro are two imports (D70) (#1753
C backend and modeled-C fixes: map loops, generic structs, view compa…
c_import/migrate/emit-c: no `-> Unit` on void C fns (#1838); header f…