Skip to content
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

nifc: add alignof & offsetof, make sizeof only take type #120

Merged
merged 3 commits into from
Nov 14, 2024

Conversation

metagn
Copy link
Contributor

@metagn metagn commented Nov 14, 2024

Unlike sizeof, alignof and offsetof only expect a type in C, so sizeof also now accepts only types instead of only expressions.

@Araq
Copy link
Member

Araq commented Nov 14, 2024

I think it's ok to change the spec so that sizeof always and only takes a type. sizeof(value) makes no sense in an optimized-for-codegens language. :-)

@metagn metagn changed the title nifc: add alignof & offsetof nifc: add alignof & offsetof, make sizeof only take type Nov 14, 2024
@metagn
Copy link
Contributor Author

metagn commented Nov 14, 2024

Done

@Araq Araq merged commit 84d362d into nim-lang:master Nov 14, 2024
3 checks passed
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.

2 participants