Skip to content

Fix size of bool handling in nimbase.h to unbreak build on powerpc-apple-darwin #25372

@barracuda156

Description

@barracuda156

Nim Version

2.2.6, master

Description

nimbase.h makes a non-portable assumption about size of bool, which breaks the build on powerpc-darwin.
https://github.com/nim-lang/csources_v3/blob/eeab3ac46e93f10efda8e58c4db02b9438319d71/c_code/nimbase.h#L328
Bool is not guaranteed to be 1-byte.

Current Output

error: static assertion failed

Expected Output


Known Workarounds

If size of bool does not matter, do not check for it, let compiler pick what is appropriate for a target.
If it must be 1-byte, do not use bool, use a type which is guaranteed to be 1-byte.

Additional Information

Size of bool in PowerPC 32-bit macOS ABI is 4 bytes.

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