From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f193.google.com ([209.85.215.193]:46574 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726562AbeJMCNt (ORCPT ); Fri, 12 Oct 2018 22:13:49 -0400 Received: by mail-pg1-f193.google.com with SMTP id a5-v6so6218229pgv.13 for ; Fri, 12 Oct 2018 11:39:59 -0700 (PDT) MIME-Version: 1.0 References: <1539274203.2623.56.camel@linux.vnet.ibm.com> <20181011203126.15338-1-ndesaulniers@google.com> <1539356751.2656.5.camel@linux.ibm.com> <80837c90-0425-aadd-38d7-c3c866d29a0a@gmail.com> In-Reply-To: <80837c90-0425-aadd-38d7-c3c866d29a0a@gmail.com> From: Nick Desaulniers Date: Fri, 12 Oct 2018 11:39:47 -0700 Message-ID: Subject: Re: [PATCH] KEYS: trusted: fix -Wvarags warning To: denkenz@gmail.com Cc: jejb@linux.ibm.com, dhowells@redhat.com, Nathan Chancellor , Eric Biggers , zohar@linux.vnet.ibm.com, jmorris@namei.org, serge@hallyn.com, linux-integrity@vger.kernel.org, keyrings@vger.kernel.org, linux-security-module@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-integrity-owner@vger.kernel.org List-ID: On Fri, Oct 12, 2018 at 10:27 AM Denis Kenzior wrote: > > 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. Thanks for the feedback. I'll wait wait to see if James is also cool with that approach, and if so, send a v2 based on the next-keys branch in the security tree as per Nathan, with yours and his Suggested-by tags. -- Thanks, ~Nick Desaulniers