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
Windows C model disagrees with itself on long double: TargetSpec says f64, the windows-gnu parse says 80-bit #2771
Two owners give different answers for the same fact on Windows:
src/TargetSpec.w:93c_long_double_is_double: true for every Windows target (os == "Windows"). This feeds ci_c_long_double_representable (src/CImport.w:615), so c_import treats a declaration passing long double as importable with c_longdouble = f64.
The C parse on a Windows host runs under the x86_64-w64-windows-gnu model (the SDK ships MinGW headers/libc; build.w:680), where clang reports sizeof(long double) == 16 (80-bit x87). The bridge (src/compiler/ClangBridge.w:1075) therefore marks the type unsupported, and the migrator refuses a function over it.
For c_import this is an ABI hazard in the D51 sense: a MinGW C function taking long double would be imported as taking f64 while the C side passes an 80-bit value. For the migrator the refusal is correct under its model.
§16.1 is model-relative ("where C's long double is wider than a double, a declaration that passes one is not imported") and does not itself name Windows. The question for a ruling: is the Windows C model MinGW (then TargetSpec's table is wrong for x86_64 Windows and c_longdouble declarations must not import there) or MSVC (then the parse triple and the SDK's header world are the mismatch)?
Evidence: on win10, with cc -E and migrate of long double p4(const char *s) { return strtold(s, 0); } -> untranslatable function 'p4': unsupported type (long double is wider than a double on this target...). Found during #809; that work makes the strtoll-family fixture ask for strtold only where the model has the type.
Activity
wip: strtold fixture follows the model's long double (#809, #2771)
build: the #809 selfhost and migrator targets run on Windows, on noth…
build: the #809 selfhost and migrator targets run on Windows, on noth…
Windows: the #809 selfhost and migrator targets run green, on nothing…
An enum of values is a value (#2549); x86_64 Windows long double is w…