Skip to content

Disable strict aliasing on clang #25067

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

bptato
Copy link
Contributor

@bptato bptato commented Jul 22, 2025

Workaround for #24596.

I also took the liberty to disable it on all targets with GCC, since their documentation claims that it is also enabled on -Os.

Workaround for nim-lang#24596.

I also took the liberty to disable it on all targets with GCC, since
their documentation claims that it is also enabled on -Os.
bptato added a commit to bptato/Nim that referenced this pull request Jul 23, 2025
Alternative to nim-lang#25067; fixes nim-lang#24596.

Pros:
* No codegen changes needed.
* No negative changes in generated code size.
* Works with all standard-conforming C compilers - conceptually, memcpy
  treats both structs as character types, which are compatible with
  all types.

Cons: it's very ugly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant