Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1007554imm; Fri, 12 Oct 2018 10:08:20 -0700 (PDT) X-Google-Smtp-Source: ACcGV63cc3Ky+O+9SjnYfNASTDd8g7z7w2l9/s6NZMhZYbkdp0QSOdejXazIVf6YPUNEO3ry3AgT X-Received: by 2002:a62:3995:: with SMTP id u21-v6mr6990354pfj.116.1539364100877; Fri, 12 Oct 2018 10:08:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539364100; cv=none; d=google.com; s=arc-20160816; b=zKc0/fjlqrU/zDwyGxUg9stgv9Bh0DW8HUiHjqG5l+T3dPm7Bpcw5Ae38CIIcrKWN6 6PbbOxNL2aaP5jPYW/0FtFe1yfulV+g8PtthPJ2Y1aOmWLUPFcncKlERCD3KQkOsmjcg 62ObkbVuVmRmvYeqc7y9Jjhg/QT90ve5Wva+nnT7tywjLieIWXIQAvGZ0X8+Wl1tq4n0 yDEJOMwVjASe9++HClRGnOrjFUa6Dkjg81pSG7Jx3Wq3ilzuEQG6vLEZFd8kn03SIe9r esXw0/7RyuZIu3AZmTL8IXGgsJx/0tHPzpWiCC7bwB1sgE+XaENIJGspgJpZ50Hcih9R O7SA== 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=p+uYe5JtXUXHeB9Dhce/DF3JebhJRFmtQIPeP5zgdEU=; b=eWr+PXLZr6ip/kiIe5nMmx9sID5iB/PFbPGWZ1SQbYetw5mNLLJXR606D454nGRGwJ eKoPhQjINpIebBAbcG/YN+KjmWmeBz4KWpmRXJKprxq+Px7q0wCZ3ekSStTzQgBaktQS hnfYsi/kxHtnfqjfj6z6RenX7kuqYeGdjHBox8Ppm0ZyMEuAOIWwYCH++Iy5NdljoJLK zBZWXkQV5vEymol+5OMzILsjK9bmlWIKLP/1mT3B68ZSJuWglOzlTQJPnkVNmCnjz3jY 1qmeX10RPiz7rRJCK71zO8gObu56aVjbIr24Bw1HTCxjBuCVWnzXLqY7rMt3s5DqVmkc v48w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=F2FUTOBL; 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 1-v6si1769678plk.405.2018.10.12.10.08.06; Fri, 12 Oct 2018 10:08:20 -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=F2FUTOBL; 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 S1727852AbeJMAj1 (ORCPT + 99 others); Fri, 12 Oct 2018 20:39:27 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:35069 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727797AbeJMAj0 (ORCPT ); Fri, 12 Oct 2018 20:39:26 -0400 Received: by mail-pg1-f194.google.com with SMTP id v133-v6so6130174pgb.2 for ; Fri, 12 Oct 2018 10:06:00 -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=p+uYe5JtXUXHeB9Dhce/DF3JebhJRFmtQIPeP5zgdEU=; b=F2FUTOBLjRyIeCtztc9CRPMhYFABQ65+hsaW3juhrG4jRzglqnOKhjBL1oHvF63ULl SCL8tpo0LLthdlgtLmK++wgY42ltN/r1eJIJPmuUicNiKKkrCg2u81qsFv+e/jiYxZBe r3i4wOVQE2rQfnHQVcRrqbyzp/p8ExG+XvAuG/J1XVnOH3ahm992/N+rflGQtvtpPPHG S7aLBTHOF4kpbIRzglZ6eFw6AAyaY9iKBSYQmLadxj3XcVpShLg0x8gxPl37Rsw3LZXR LdMoJI6qTmemQHBx1iPxK0O/6Q1hFJyPkV1QhF0Uji+wc/kVyJhh8J4VcZKXWIYEElhJ 6qhg== 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=p+uYe5JtXUXHeB9Dhce/DF3JebhJRFmtQIPeP5zgdEU=; b=a0Rh7+WusHuiLCGA69+NjZKyQUa+pkoG0A1eEWtZSfXGmwLXcA+JBJ1qk8ed72ULjo nJ9LbqRMh03ZHhZaU1IdPDROLqtTpQe9U5/uVosNDmp8hgEIbT+HQY5wGJBhatNgaUfI 2oQqvjlZqdz9+yIqp7rbPZIZUFynwfKI15KWAW9jLWYJNh97MBdyrj8+nBFDeE/SdO+L JCeIgBgbUmX0LkJb3/cOnquOSVyBBLl3RhX+Oxl/hAptqN7oMaKEMuXxW6igpV9GyNVR RJKnwTseuNRAJBb5JsLCnvT7Kefpl/5dK50979LTkTkZ7Zvl8n/FLEy62uUoastyd1QZ jHIw== X-Gm-Message-State: ABuFfoh7Z+uTT/HD+v0Fatiq8KPgBvQxGV9pw8GaGPFlKLzPU0uEjckh WyZLz/kfPDipBwLyXKR9MnyC08R3mgHjcBz1pC4hZw== X-Received: by 2002:a63:9e02:: with SMTP id s2-v6mr6379313pgd.302.1539363959493; Fri, 12 Oct 2018 10:05: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> In-Reply-To: From: Nick Desaulniers Date: Fri, 12 Oct 2018 10:05:48 -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 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/ > > 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