[PATCH] kbuild: treat char as always unsigned

Sascha Hauer s.hauer at pengutronix.de
Tue Apr 22 01:14:27 PDT 2025


On Tue, Apr 22, 2025 at 09:52:06AM +0200, Ahmad Fatoum wrote:
> Hello Sascha,
> 
> On 22.04.25 09:42, Sascha Hauer wrote:
> > 
> > On Tue, 22 Apr 2025 08:39:10 +0200, Ahmad Fatoum wrote:
> >> The C standard makes it implementation defined whether a plain char is
> >> unsigned or signed and the architectures where barebox is compiled for
> >> differ in that, e.g. chars are traditionally unsigned on ARM, but on x86
> >> for example they tend to be signed.
> >>
> >> This caused different bugs[1][2][3] in the past, especially around
> >> behavior when casted to int. Let's instruct the compiler to treat char
> >> as always unsigned. This may fix some issues that flew under the radar
> >> so far, but also break drivers that were compiled and used only for
> >> specific architectures, which implicitly assumed char is signed, which
> >> we'll have to fix.
> >>
> >> [...]
> > 
> > Applied, thanks!
> 
> Please wait with this until after the release, so it sits in next for
> a whole month first.

Ok, dropped for now. Please ping me after the release in case I forget.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list