Skip to content

Conversation

kkysen
Copy link
Contributor

@kkysen kkysen commented Aug 25, 2025

This adds support for CTypeKind::UnaryType in --translate-const-macros conservative. Previously, these UnaryTypes received the non-portable type of c_ulong, which failed to compile since their Rust translations like mem::size_of return usize. On the C side, sizeof expressions are indeed supposed to have type size_t, so they should get the portable type CTypeKind::Size. This adds this type in fn bubble_expr_types, which might not be the right place to do so, since that's currently for fixing up the types from clang 15. This type fix could instead be moved to a separate pass as well. In doing so, I also cleaned up some minor stuff in fn bubble_expr_types, which should be easier to review if you ignore whitespace changes.

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