-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
I was hacking on #7728, trying to get rid of numerous suspiscious u32 casts, and realized that many of them have to do with libc::mode_t
alias. In most unix-like OS, it uses u32, but some use u16 and Redux uses i32, making this somewhat problematic.
Coreutils code constantly casts from mode_t
to u32
and back. I think a better paradigm might be to introduce a dedicated type, probably based on bitflags? In general, a strongly typed flag type should be better than a generic u32 passed around. My only reservation is that maybe this should be part of libc itself?
See also rust-lang/libc#4404
Metadata
Metadata
Assignees
Labels
No labels