From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it1-f196.google.com ([209.85.166.196]:51729 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725854AbeJMBAf (ORCPT ); Fri, 12 Oct 2018 21:00:35 -0400 Subject: Re: [PATCH] KEYS: trusted: fix -Wvarags warning To: Nick Desaulniers 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 References: <1539274203.2623.56.camel@linux.vnet.ibm.com> <20181011203126.15338-1-ndesaulniers@google.com> <1539356751.2656.5.camel@linux.ibm.com> From: Denis Kenzior Message-ID: <80837c90-0425-aadd-38d7-c3c866d29a0a@gmail.com> Date: Fri, 12 Oct 2018 12:27:00 -0500 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Sender: linux-integrity-owner@vger.kernel.org List-ID: 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