Landing: ac6b87632681
Project / Subsystem
gcc / gccrs
Date
2026-06-28
Author
Lucas Ly Ba
Commit
ac6b8763268139027c363dfe7c0eb51eedc82b6c
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- gccrs
- patch_id
- —
- commit_hash
- ac6b8763268139027c363dfe7c0eb51eedc82b6c
- source_type
- github
- headline
- gccrs: add repr_c_enums_larger_than_int lint
- tldr
- gccrs warns about non-portable #[repr(C)] enums larger than C int types.
- author
- Lucas Ly Ba
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • gccrs
- • rust
- • compiler
- • lint
- • ABI
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-06-28T00:00:00.000Z
A new lint in gccrs warns about Rust enums marked with #[repr(C)] whose discriminants exceed the size of C’s int or unsigned int. Such enums are non-portable because C standards (since C23) restrict enum sizes, and Rust’s isize interpretation for repr(C) discriminants might not match the C ABI. The discriminant is evaluated at compile time for this check.