Skip to content

c_import of <float.h> fails: clang 22's __float_*.h parts are not embedded #1198

Closed

Description

@ehartford
use c_import("float.h")          // or CoreFoundation/CoreFoundation.h, or anything that reaches <float.h>
fn main: print("ok")
error: failed to compile C header snippet: float.h: '__float_header_macro.h' file not found

Cause: build/clang_resource.w cr_should_embed embeds a curated subset of clang's builtin headers. clang 22 split float.h into __float_float.h, __float_header_macro.h, __float_infinity_nan.h; the rule knows the __stddef_ / __stdarg_ prefixes but not __float_, so float.h is embedded and its parts are not. Scanning every embedded header's #include lines against the SDK's include dir finds exactly those three and nothing else.

The tool that stayed silent: the embed action never checked that the subset is closed under inclusion. Fix adds the prefix and makes the action fail with embedded clang header set is not closed: float.h includes __float_header_macro.h (verified firing under the pinned seed, then passing).

Activity

  1. added 4 commits that reference this issue on Sep 19, 2026
    bb342e6
    6ccb3d6
    8ab2dd5
    7d4dbdb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions