[lkml]   [2018]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [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`.

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.


 \ /
  Last update: 2018-10-12 19:28    [W:0.187 / U:2.984 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site