[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <80837c90-0425-aadd-38d7-c3c866d29a0a@gmail.com>
Date: Fri, 12 Oct 2018 12:27:00 -0500
From: Denis Kenzior <denkenz@...il.com>
To: Nick Desaulniers <ndesaulniers@...gle.com>
Cc: jejb@...ux.ibm.com, dhowells@...hat.com,
Nathan Chancellor <natechancellor@...il.com>,
Eric Biggers <ebiggers@...gle.com>, zohar@...ux.vnet.ibm.com,
jmorris@...ei.org, serge@...lyn.com,
linux-integrity@...r.kernel.org, keyrings@...r.kernel.org,
linux-security-module@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] KEYS: trusted: fix -Wvarags warning
Hi Nick,
>> So maybe I'm misunderstanding something, but the issue seems to be that
>> unsigned char is promoted to 'unsigned char *' by Clang and probably
>> unsigned int or int by gcc.
>
> No. This is extremely well defined behavior in C. In C, integral
> types are NEVER promoted to pointer to integer types, only to larger
> integral types through rules more complicated than the correct flags
> to pass to `tar`.
> https://xkcd.com/1168/
>
Ah right. Thanks for the correction. So looks like bool won't work for
the same reasons. But unsigned int should work right? But then again
this is a boolean value and if we want to be paranoid we can simply
tweak the 'c = h3' assignment to be something like:
c = !!h3;
So in the end, I'm happy with int or unsigned int.
Regards,
-Denis
Powered by blists - more mailing lists