Skip to content

aliasing violations #15

@kjsdf7wr3

Description

@kjsdf7wr3

Code like the following violates aliasing rules, an object shall only be accessed through its declared type or through a char pointer.
I think only the only legal way is to use memcpy (or assembly). Type punning through unions does not help here.

#define cw_store32(x) *(uint32_t*)p = (uint32_t)x;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions