Unnecessary unsafe
for libc::major
and libc::minor
? Or is libc::makedev
missing unsafe?
#3759
Labels
C-bug
Category: bug
libc::major
andlibc::minor
functions are unsafe. The reverse operationlibc::makedev
is not.makedev
is also unsafe, unlike other platforms.I have not been able to check the man page of every single Unix system, so maybe there is one where this makes sense. Otherwise I think this is an oversight.
I think one or both of the following should be done:
makedev
andmajor
/minor
in how unsafe vs not unsafe is handled across platforms.major
/minor
are wrong.makedev
is wrong. I can see the argument to not get lints about unnecessary unsafe blocks, but that only works if it is done consistently.I also very much doubt there is any Unix where any of these functions could reasonably be unsafe. After all, even the C function will only do some arithmetic.
Minimum working example (not that I think it makes sense here):
Target triplet: x86_64-unknown-linux-gnu (and several other ones I checked)
Libc version: 0.2.155
The text was updated successfully, but these errors were encountered: