Skip to content

ImportC: alignment value expected, not _Alignof #21150

@drpriver

Description

@drpriver

Following C code (found in some system headers on macOS) fails to parse with importC:

#define _STRUCT_ARM_SVE_Z_STATE struct arm_sve_z_state
_STRUCT_ARM_SVE_Z_STATE
{
	char            z[16][256];
} __attribute__((aligned(_Alignof(unsigned int))));

Fails with "alignment value expected, not _Alignof”.

Unfortunately, this clang attribute is not documented: https://clang.llvm.org/docs/AttributeReference.html#alignas-align-alignas-aligned

but I imagine it should be able to take anything that evaluates to a compile-time constant integer expression.

Why they couldn’t use a standards-compliant solution I don’t know...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions