Re: [PATCH v2] [PATCH] KEYS: trusted: fix -Wvarags warning
From: Nick Desaulniers <hidden>
Date: 2019-02-11 18:37:06
Also in:
keyrings, linux-integrity, lkml
On Mon, Oct 29, 2018 at 10:54 AM Nick Desaulniers [off-list ref] wrote:
On Wed, Oct 24, 2018 at 1:37 AM Jarkko Sakkinen [off-list ref] wrote:quoted
On Mon, 22 Oct 2018, ndesaulniers@google.com wrote:quoted
Fixes the warning reported by Clang: security/keys/trusted.c:146:17: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs] va_start(argp, h3); ^ security/keys/trusted.c:126:37: note: parameter of type 'unsigned char' is declared here unsigned char *h2, unsigned char h3, ...) ^ Specifically, it seems that both the C90 (4.8.1.1) and C11 (7.16.1.4) standards explicitly call this out as undefined behavior: The parameter parmN is the identifier of the rightmost parameter in the variable parameter list in the function definition (the one just before the ...). If the parameter parmN is declared with ... or with a type that is not compatible with the type that results after application of the default argument promotions, the behavior is undefined. Link: https://github.com/ClangBuiltLinux/linux/issues/41 Link: https://www.eskimo.com/~scs/cclass/int/sx11c.html Suggested-by: David Laight <redacted> Suggested-by: Denis Kenzior <redacted> Suggested-by: James Bottomley <redacted> Suggested-by: Nathan Chancellor <redacted> Signed-off-by: Nick Desaulniers <redacted>Reviewed-by: Jarkko Sakkinen <redacted> /JarkkoBumping the maintainers if this isn't already picked up?
James, Jarkko, or Mimi, can you please pick this up (and let me know what tree it lands in)? https://lkml.org/lkml/2018/10/23/116 -- Thanks, ~Nick Desaulniers