[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <de9ccf7da0aa441b855fdfbd7761115a@AcuMS.aculab.com>
Date: Mon, 15 Aug 2022 10:37:42 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Linus Torvalds' <torvalds@...ux-foundation.org>,
Nick Desaulniers <ndesaulniers@...gle.com>
CC: Joe Perches <joe@...ches.com>,
Nathan Chancellor <nathan@...nel.org>,
"Sudip Mukherjee (Codethink)" <sudipm.mukherjee@...il.com>,
Masahiro Yamada <masahiroy@...nel.org>,
Michal Marek <michal.lkml@...kovi.net>,
"linux-kbuild@...r.kernel.org" <linux-kbuild@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
clang-built-linux <llvm@...ts.linux.dev>,
Justin Stitt <justinstitt@...gle.com>
Subject: RE: mainline build failure for arm64 allmodconfig with clang
...
> And often that char isn't actually a 'char', it is actually an 'int',
> either because you have situations like 'getch()', or you have simply
> just the usual C expression rules, ie you have something like
>
> isprint(c) ? c : '.'
>
> where even if 'c' is of type 'char', the end result is 'int'.
Which is, of course, invalid C :-)
The domain of the isxxxx() functions is 'the values of char
cast to unsigned int' and EOF.
So typically [-1 .. 255].
Passing a signed char variable to isprint() is likely to
generate undesired behaviour (like a code dump).
It has to be said that I did a full trawl through the NetBSD
userspace code base to fix all the isxxx() calls and failed
to find a single one that could actually pass EOF.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists