Skip to content

Unaligned EventBuffer on SPARC #311

@pipcet

Description

@pipcet

The event buffer code in event.c declares EventBuffer as an array of arrays of char. That means the variable may end up not being 8-byte aligned on some systems, such as SPARC systems with the Sun ABI.

Since SPARC requires double values to be 8-byte aligned, this causes crashes.

My current solution is:

char _Alignas(double) EventBuffer[EventKindLIMIT][EventBufferSIZE];

But that is not ISO C90 because it uses _Alignas.

What's a better way to fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions