Re: + kbuild-treat-char-as-always-unsigned.patch added to mm-nonmm-unstable branch

From: Alexey Dobriyan
Date: Thu Oct 20 2022 - 05:44:05 EST


On Wed, Oct 19, 2022 at 05:03:55PM -0700, Andrew Morton wrote:
> This will break things in some places and fix things in others, so this
> will likely cause a bit of churn while reconciling the type misuse.

> --- a/Makefile~kbuild-treat-char-as-always-unsigned
> +++ a/Makefile
> @@ -562,7 +562,7 @@ KBUILD_AFLAGS := -D__ASSEMBLY__ -fno-P
> KBUILD_CFLAGS := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
> -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
> -Werror=implicit-function-declaration -Werror=implicit-int \
> - -Werror=return-type -Wno-format-security \
> + -Werror=return-type -Wno-format-security -funsigned-char \
> -std=gnu11
> KBUILD_CPPFLAGS := -D__KERNEL__
> KBUILD_RUSTFLAGS := $(rust_common_flags) \

ACK

Another reason is that characters were always some small non-negative
integers which mapped to pictures so making them signed was silly from
the beginning.

People should use "const char *" for C strings and "u8[]" for raw buffers.
Unfortunately, C can't give developer more.