Re: [PATCH] vboxsf: fix old signature detection

From: Arnd Bergmann
Date: Mon Sep 27 2021 - 09:22:12 EST

On Mon, Sep 27, 2021 at 3:02 PM Dan Carpenter <dan.carpenter@xxxxxxxxxx> 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.

More specifically, ' think '\377' may be either -1 or 255 depending on
the architecture.
On most architectures, 'char' is implicitly signed, but on some others
it is not.

The original code before 9d682ea6bcc7 should have worked either way because
both sides of the comparison were the same 'char' type, marking one of them
as explicitly 'unsigned char' seems to have broken all architectures on which
the type is implicitly 'signed'.