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
c_import: translated inline bodies wrap D42 math builtins in unsafe { }, refused as "unsafe block contains no unsafe operations" (MSVC <corecrt_math.h>, 16 errors on a full SDL.h import) #1876
Found verifying #1872 on win10 (SDL 3.4.14, use c_import("SDL3/SDL.h")). MSVC's <corecrt_math.h> declares inline float wrappers (fabsf, acosf, asinf, atanf, atan2f, ceilf, cosf, expf, floorf, fmodf, logf, log10f, powf, sinf, sqrtf, tanf) that c_import translates as return unsafe { acos((__param__X as f64)) }; since D42 those are compiler builtins and not unsafe, so every wrapper is refused. Windows-only (Darwin's math.h has no such inlines). Expected: the translator wraps a call in unsafe only when the callee's call is unsafe (one owner: the same fact Sema uses, cf. #1830). Repro: a Windows use c_import("SDL3/SDL.h") with the #1872 branch: 16 errors.
Activity
c_import: full SDL.h imports — zero-parameter macro return types, D42…