Re: [PATCH] vboxsf: fix old signature detection

From: Rasmus Villemoes
Date: Tue Sep 28 2021 - 05:56:23 EST


On 27/09/2021 15.02, Dan Carpenter wrote:
> GCC handles it the same way as Clang. '\377' is -1 but in Sparse it's
> 255. I've added the Sparse mailing list to the CC.

FTR, while examples are not normative, this:

EXAMPLE 2 Consider implementations that use two's complement
representation for integers and eight bits for objects that have type
char. In an implementation in which type char has the same range of
values as signed char, the integer character constant '\xFF' has the
value -1; if type char has the same range of values as unsigned char,
the character constant '\xFF' has the value +255.

doesn't leave any ambiguity or (implementation|un)-definednes, and
sparse interpreting '\377' as 255 independent of its
target->unsigned_char is a plain bug in sparse.

Rasmus