Thread (33 messages) 33 messages, 8 authors, 2019-02-14

Re: [PATCH] KEYS: trusted: fix -Wvarags warning

From: James Bottomley <hidden>
Date: 2018-10-12 15:26:04
Also in: keyrings, linux-security-module, lkml

On Fri, 2018-10-12 at 10:13 -0500, Denis Kenzior wrote:
Hi James,
quoted
quoted
So can't we simply use 'bool' or uint32 as the type for h3
instead
of re-ordering everything
The problem is the standard is ambiguious.  The only thing that's
guaranteed to work for all time is a char *.  If you want to keep
the
order, what I'd suggest is inserting a dummy pointer argument which
is
always expected to be NULL between the h3 and the varargs.
https://patchwork.kernel.org/patch/10274411/
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.

So instead of having unsigned char h3, can't we simply have bool h3
or unsigned int h3?
Or actually, we fix this like I did for tpm2 in an unmerged patch and
compute the hmac over the constructed buffer not using varargs:

https://patchwork.kernel.org/patch/10274411/

James
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help