Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1027993imm; Fri, 12 Oct 2018 10:29:01 -0700 (PDT) X-Google-Smtp-Source: ACcGV60IoZ/VVBLuhePsa7QY4bcPsxPOe3miFv1P4rn4c6031pj/C31M5qb0m6RtYBLiXr3eoiTq X-Received: by 2002:aa7:814f:: with SMTP id d15-v6mr7042185pfn.78.1539365341050; Fri, 12 Oct 2018 10:29:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539365341; cv=none; d=google.com; s=arc-20160816; b=hXztqHzKSoYO2C6HFen1bn9VNbt24Hrg6dBuqAXwK+dj9CwiZ29n9wAcmTDt8bveNg kONllMhHMVzswehB8H95Xn2YgbByl84bQ7NGiMIsS1lnmCT1Y2/0LOpq17OeOcUntLjo nwCX8L+w14yZ+LX8Vz4qa6OT6VUGwcjLdJq0hcd8qSIH4d078vfoOyOBVeaoJtdb4X7i AaKhHOICQgIneZ1CE4dOExSb53PwYZWe7lfKJod4HviUomwz31sb86pEu2TCyS87QTbP nZ+bOeEW5mAvankhO2ObDqKyJkJiqrIEExXmmjxXKU99EiBpKjygQWO5lFsyCYr1kjen EMGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=1c8CzJ13SCIpEhVf+sCWxU+rNfx1+0YK8EYSi19xYkI=; b=Zf8oFvXTyUYgquIFZ14XijDgl6o1o9kTPlSYM5C0KxQ6N29tkGIVlB6cBDpiAAbbjT itEkTV1i+CNBfUSAol9lKT0CHbBv2k4nNRxAhoLnp/cbKfpm0UI+FbdoNUxeybwWkT2E NNaDosmYhaU6ONbjNkZZG1HaCJyudweFXVqY8nJlVRxWblWjO0P+T7JDtbxd1d/LbA8C 0WpwEOgZvK1NvMp9NlJnCVkQCOIQ47mA/DImktNspY3qD0uLyJ0J5Sy4m8jxSeREsmyk Kor32kJEQfPrIOGqcZkCoubOaJIvzYxhwEQoTVXeb/E/duBJCgJjzM3Cmhm9rKu+Z7+4 IJwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MYJoKQ3N; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w24-v6si1737302pll.346.2018.10.12.10.28.45; Fri, 12 Oct 2018 10:29:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MYJoKQ3N; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727358AbeJMBAf (ORCPT + 99 others); Fri, 12 Oct 2018 21:00:35 -0400 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 Received: by mail-it1-f196.google.com with SMTP id 74-v6so19887197itw.1; Fri, 12 Oct 2018 10:27:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=1c8CzJ13SCIpEhVf+sCWxU+rNfx1+0YK8EYSi19xYkI=; b=MYJoKQ3NyRWaUYBHomHu0Ip1MnozaJKS7+BsXIiy/WDLyjHZCUTXhJjeh7aMn39M0s cXTnTgA2z/G5MsvRtuwhDwdteaHd6h8uagd15//7jj+nd8gFiToTvv/u7jfcBKwijnCg JSdfHEBPCmYu0I7/1HIrQ8FKLtxDFiX1OLyIaAx5kZ6/DkQcuIiHAS2a1WnyQEFITSFr MzmuyWUpB+WUlNNhiRyvuJ5yFOPOFFM6YIpqbYAp96q/NnfzCtBu5JwFkru7rE/r7r6L xaAb8GNaWHgvSvDjzO9IGaqkNpyIeVM+zVPNtAym9laxnzAQwEb0q2d2uGeJn4be4vlE q+lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1c8CzJ13SCIpEhVf+sCWxU+rNfx1+0YK8EYSi19xYkI=; b=nDd1icSg+kRc9QwkAf4zmsToyjht8XJkGvEvUPeYFz8QMq8bSXHWeSuNR2ROQCd6u3 TkOfvI6cQhsXS22VVwX8kbLke0aA3zmlajWYTa7gtP3WoK0mElJQpND9RcvKkrztnhFZ YEUWkQ9deL/Np9TMRK6da9uldgk6sl4FlQoZqIqSsJKnvIqe2WMg39lHEwXuiLxG56pD 7gO3J7qSVEUiXMhlx6/0X6XfX9eoTZ4vjEYTZOMd6RoffQO9HFmqycRwKw1jt0EtgUYe gwD0SvpMHsGLsZdn0laEIxy2BWO3ycNCKGthZI505bOncZW7v2aPZnDZaBvSYPNLi/Ph e6EQ== X-Gm-Message-State: ABuFfojN/bENr/UzAJj99Qw9cPuWeVF0P7vdfampwmabBeDWpOSt5qwY O7gSwDicAK6tjzZo+MU99iBwtFsn X-Received: by 2002:a24:4169:: with SMTP id x102-v6mr5620897ita.128.1539365222366; Fri, 12 Oct 2018 10:27:02 -0700 (PDT) Received: from [192.168.1.249] (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.googlemail.com with ESMTPSA id s10-v6sm876799itb.38.2018.10.12.10.27.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Oct 2018 10:27:01 -0700 (PDT) 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 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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