One of the changes in an early pull request before the Linux 6.2 merge window opens next week is to enable “-funsigned-char” by default for Linux kernel builds, which means that if not specified, the “-funsigned-char” compiler flag will All “char” character types are set to unsigned.
C’s char character data type is divided into signed char and unsigned char, where unsigned char occupies all 8 bits of memory and has no sign bit.
char is unsigned in the standard, but different CPU architectures/compilers can implement it as signed or unsigned. But when this change is merged, the default char type will generally be treated as unsigned for kernel code written using the normal “char” type.
WireGuard lead developer Jason Donenfeld led the -funsigned-char conversion effort in the Linux kernel.Back in Linux 6.1, Jason Donenfeld triggered a build error when compiling the driver on ARM, when the driver assumed bare
char The type is signed, but ARM treats it as unsigned, and the C standard says it’s architecture-dependent.
After discovering this Char type confusion issue, he made a “treat char as always unsigned” build request. And an early PR was sent for Linux 6.2 enabling unsigned char behavior by default, along with various kernel fixes for kernel code making different assumptions about the signedness of the char type.
Interested friends can find more details in the build request and early PR email.
#Linux #enables #funsignedchar #char #types #set #unsigned #News Fast Delivery