-
Notifications
You must be signed in to change notification settings - Fork 55
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
Enum sizes #308
Enum sizes #308
Conversation
src/Parser.zig
Outdated
@@ -2076,6 +2087,40 @@ const Enumerator = struct { | |||
e.res = res; | |||
// TODO adjust res type to try to fit with the previous type | |||
} | |||
|
|||
fn tagSpec(e: *const Enumerator, p: *Parser, is_packed: bool, tok: TokenIndex) !Type.Specifier { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spec
in enumSpec
and recordSpec
comes from the official grammar, maybe it would be better to call this getTagType
or even just tagType
?
clang also tracks the promotion type of enums but that *seems* to be a C++ feature
This is a C++ feature that clang supports for C as an extension.
Thanks for this! This might still need some tweaking to match clang, on my machine clang says the enum in Also sorry for hijacking your branch at the end. I assumed you were done with this thought to add the two missing parts so that this PR would get enums to a (mostly) complete state but they turned out to be more complex than I assumed. |
Sounds good! I can take a look at the overflowed enums |
Calculate enum sizes, accounting for packed attributes and overflow