Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1019049imm; Fri, 12 Oct 2018 10:19:06 -0700 (PDT) X-Google-Smtp-Source: ACcGV60gXk4F1LZq9YpJJjLEFaaM4L1x4SrAL89LgA2OiIIwh8T6mDPqyaA3uS1JrXPjDBTiJpn8 X-Received: by 2002:a17:902:f203:: with SMTP id gn3mr6440762plb.93.1539364746440; Fri, 12 Oct 2018 10:19:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539364746; cv=none; d=google.com; s=arc-20160816; b=cIOlrLtgm4/ZhrawLuWuAEqabjexe5qjz72E/s6+lAOjiWwUQerBsOWOHC5bdsG63J iA/C3ZJOT1w5QhTY/R5DveMFNyxPmxb8wQ1w6qRABMrTDj13jRWKrfD+52GGeb2jiBnm W3q2MAEr/e8TA1tFbdQ8LNZ/IxFhiFg4zssJdfZNVyyG6w0/D1QHSFiiX6wE1aAqV80n Swumode8XLMxVRkQ4ALNa4oji6/e3so7cWA6PN9eLSR+333dPfKLOaOkzUwGHvgzGnEm 2F+DwAwVtGqMpsY6+MYMrk/UY2yoydY8PkNPHBO3UcmwzdBsZWk4eWXO6Tq35pKVHy0+ LfTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=FXKGUvsBIsHfC+bWM0ycsgSPx4MUBhea/BLf9ywmShw=; b=UgIh4tP+PEtkDGCoOpjqTNNPfZuUsk+Mg7VhHi+GaDLuSPkdXXMvI22cfvjMgYxgDE PDXX4NHloXl2Fzw8AMgIE9rrq33HN1kVq1xZzC/VE3wnWihlSAAsV3jGpzUZJmEonYxg kEp+X8ay9y5oWG7dYwQys3zZXq79dmZTtFpKTNSt8OYlGp5Brc82Drrv3hgnY5abyDpj t2kI2hcpW6jfwXPPJ1bQQB5wQB8PFG3uv+aWj4vW32pCQ0KREB29JrhgwbpHgJGSLt1E CzEiVvL5Ow0LH9xmRJ5IDsE9FlKAJ5iko4mAmRVQl0bhLB+BtraXvDYrNQqQG65oZ5MH dkpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=p9AMfgAA; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v4-v6si1649551plp.247.2018.10.12.10.18.51; Fri, 12 Oct 2018 10:19:06 -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=@google.com header.s=20161025 header.b=p9AMfgAA; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727478AbeJMAvb (ORCPT + 99 others); Fri, 12 Oct 2018 20:51:31 -0400 Received: from mail-pf1-f181.google.com ([209.85.210.181]:40034 "EHLO mail-pf1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727195AbeJMAvb (ORCPT ); Fri, 12 Oct 2018 20:51:31 -0400 Received: by mail-pf1-f181.google.com with SMTP id s5-v6so6518653pfj.7 for ; Fri, 12 Oct 2018 10:18:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FXKGUvsBIsHfC+bWM0ycsgSPx4MUBhea/BLf9ywmShw=; b=p9AMfgAAFpHxpyOE+mnmQTh8xcG/P0bNlh5DV7GUpXdfIL8+6rL3qYb1FQi1mZQXGC 2WA193JQxC/Mq9zYWAsN9vy3Ii8/g5aj0E3wcPuUYlwapsSb29uIlPSXPlD0H5osRiPs dPKzN57jEQATRmRIvLnVl1tVD+cAjpMGerL5Qe/RUUQoVM/AHJzJaYpJvBAIY7pIAZqn DnoVzXpbVNemnqg76W2DtAflSGWkP92Fw+CA1UzAJEpjfD94AmDHeMUJDAbKus6n+H+k LV9joSu8FezTzjVJu/njLik9/e+a2FRfjo0S6WKtYPthlvDskQio5gjDczjR7iPrDJEv fO/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FXKGUvsBIsHfC+bWM0ycsgSPx4MUBhea/BLf9ywmShw=; b=sTah9bdfykOuikGUc8KWbqhuO0QMg0W+UVBtAH3N9iM5cXpRkexdX4pyoZd4x+/bak 3s02ksFOBGsLj48TO89vhoHR2jlg4z4Y11Vt+9qDvxb/vaIVKIxzAUngilb+RhDZGNgp URQMULiM5FO2xm8SYjc0CbQctZJ83nA2PG4BVr5eLaNpU9rVNw71DMELa6IVdoJ3p5eF vC1eVMUTw1GAETjZ7DY+E710AWBJhjpFwkf8buy4PA164eEZq1APmHwV9mGLq26vyf3B 3efeVwGy+xDo8apJk9z1eqAr048VJLSRuoQZnflDUgIldsuwbNWwRrFY1IPpMjqJGfcJ uwPw== X-Gm-Message-State: ABuFfogwXxz4tizUn3AsJyvjptRi7NPIT3FO78TpvFAwqvPQkP2DY1I2 bwzxvJPGe96W1QLfUy9jaF0ormkyPl4ZBZ2qqpEHrg== X-Received: by 2002:a63:9e02:: with SMTP id s2-v6mr6418895pgd.302.1539364681413; Fri, 12 Oct 2018 10:18:01 -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> In-Reply-To: From: Nick Desaulniers Date: Fri, 12 Oct 2018 10:17:50 -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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 12, 2018 at 10:05 AM Nick Desaulniers wrote: > > On Fri, Oct 12, 2018 at 8:14 AM Denis Kenzior wrote: > > > > Hi James, > > > > >> 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. > > > > 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/ And may have their signedness converted. https://wiki.sei.cmu.edu/confluence/display/c/INT02-C.+Understand+integer+conversion+rules is the reference I use, though I always feel like there's quite a bit of mental gymnastics involved interpreting it. > > > > > So instead of having unsigned char h3, can't we simply have bool h3 or > > unsigned int h3? > > int is the default argument promotion. Proposed: > https://github.com/ClangBuiltLinux/linux/issues/41#issuecomment-428365339 > > > > > Regards, > > -Denis > > > > > -- > Thanks, > ~Nick Desaulniers -- Thanks, ~Nick Desaulniers