Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp4310958pxb; Sat, 5 Feb 2022 09:29:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJzGITcyDynbz8U63qZyzP2L29+OovSLai6dvaxKR9jVRe68lNKIWQQJ6LZ6a2elzamPEHqh X-Received: by 2002:a17:903:1ca:: with SMTP id e10mr872658plh.65.1644082181082; Sat, 05 Feb 2022 09:29:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644082181; cv=none; d=google.com; s=arc-20160816; b=LVNxakO1Cz0BRvPxnk/YiHfllnOMBJCIciKId/T7cOhJMhupqyFRtmYe2ePRzwhbTf UiZkXBZm/OimcnIo25yorIu+g6R5eDspx5DGiAdROuMyqPEaiRRAFRyymOXCy/YjY6kw aNpPpbGMZMTaPiApa+1Z5T/tJ8y4qCRovhWLd6tQk1GwxgkK7kksR116SqQcs8vQBoTK 2Cxh9vz1TdVm3qgoI9mA6eIFaDSN5NRwffE5J4KIXGXWos/CcE8Z/NOzArdWPCQpJgT3 vVe5lcZ/oh7xhw+dyz3JSK5jnyGpyE1q8OWyH95hBsrC/myNNY/besQUs97qDM80+rkC 2IRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=+joIfLcwi0AHT9CfmeRWcZipKd8v5eWFKJZkkqDlqIo=; b=tUebo9TryuPTcthfs5baSukP4nsL2LOJ72fmrPdEYg0mA75CeaROdZPWtpdaqJ8P0o WstuWh/YoDuWcxtkxEvLOC9Fv5pc75qQHab+YJkdWvmWwAYIA+4JTYMwIiFIxUqbmOjI XidI7djrvsaOJPBTWg0P0krUVqAjLCQ080k39XDPe2DVubHGDOTLJ2iYuKF9A3mWIMH5 JKwc/FZ4wawc7Enj1R3RACQPTLYa/3ybhyM02inwY9gMJ59GYkU8ewUDZBOXCC8EoGLt tsQUijMLR0lQnejV2foM7pkm4x+h8lO9BfNxiYMCQo4iWMMJQjwQPIrxZfWVoxisTUXt +ZPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Cpz+g9im; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k1si5928534plk.424.2022.02.05.09.29.29; Sat, 05 Feb 2022 09:29:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Cpz+g9im; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1345948AbiBBUOC (ORCPT + 99 others); Wed, 2 Feb 2022 15:14:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236790AbiBBUOB (ORCPT ); Wed, 2 Feb 2022 15:14:01 -0500 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D5DCC061714; Wed, 2 Feb 2022 12:14:01 -0800 (PST) Received: by mail-io1-xd2b.google.com with SMTP id 9so539245iou.2; Wed, 02 Feb 2022 12:14:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+joIfLcwi0AHT9CfmeRWcZipKd8v5eWFKJZkkqDlqIo=; b=Cpz+g9imX/K+prVNM2ef9ZNuDEmBDl87wa3qhiO7PkJtVw6JxD2J/yzwqCfExLFDul dInhS/EKoCg1Lp5yPwLbPoZHc7QK0wTCVUS5bhgOUvf+JwIvBqNbPZFGwRwr+PXr0j2O 6jDlo0h+iWkjd09guUmisZ4JUnZYOgipwJCIt7+3cHXmECHOvGFEsaTMoW/N+9f1nnNO hYuvJidRQqB0TgWayFIZUaDfRQAcbFMOw+7VHPasyP6P5MxEcEf8hGyfKXUZHWV6EiPB IqeB3TwpL+TkB4+tIvXcck3FalTnKYvGqxMcA++WknXE94iDDm2OKGSBwf1CRy0XUE99 2e8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+joIfLcwi0AHT9CfmeRWcZipKd8v5eWFKJZkkqDlqIo=; b=g3FOJd+Vs135wja3+019HM85rkAIPLOGM4UTqAub1+iiOq2sCjNbAJ3/wrGBGyRUuq XzM3j81bhC1cwaCgp69glmS26tm4FPRaZG31iYDyoBpBkgnugDh/K8s1dgfNGJn+VW7O rZoF4iwmN/yQm0ehwSinL6RsLSV6HiNqjT0cPH+DnDP9lw600PzfjaxqOxPGxITVqkw5 wuaFEpCprj15jt4uvKAuIUutoSy9cVyc63emcBBrgfrNqyTKt1PLJkAWodocdiD8AbdT 7iE/ej6RQsUCtDUhoHuUd1c61Y52357YDJI+zonlXChW8e2tjjbvmtt/VoJhoF7y6XRK i7Sg== X-Gm-Message-State: AOAM530mLPx6yeW0CyS395r5xErFBYQUAjDGz0MKBNDwK/pwlGFUH1gD R2lGaXZT4KmhIwGuY5eGe7B5YKqMuxHALFY290Y= X-Received: by 2002:a6b:ea08:: with SMTP id m8mr17027283ioc.172.1643832840579; Wed, 02 Feb 2022 12:14:00 -0800 (PST) MIME-Version: 1.0 References: <20220131204357.1133674-1-keescook@chromium.org> <6641e01b86374ce197020d57c65ae3b3@AcuMS.aculab.com> In-Reply-To: <6641e01b86374ce197020d57c65ae3b3@AcuMS.aculab.com> From: Miguel Ojeda Date: Wed, 2 Feb 2022 21:13:49 +0100 Message-ID: Subject: Re: [PATCH] linux/const.h: Explain how __is_constexpr() works To: David Laight Cc: Kees Cook , Jonathan Corbet , Linus Torvalds , Martin Uecker , Ingo Molnar , Rikard Falkeborn , Arnd Bergmann , "linux-doc@vger.kernel.org" , Tetsuo Handa , Andrew Morton , Andy Shevchenko , Nick Desaulniers , "Gustavo A. R. Silva" , "linux-kernel@vger.kernel.org" , "linux-hardening@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 2, 2022 at 5:19 PM David Laight wrote: > > - The conditional operator (?:) requires that both expressions have the > the same type (after numeric promotions). I think you are referring to the arithmetic types case, but that one does not apply here. > - If the expressions have distinct non-NULL pointer types then they are both > cast to (void *) and the result has type 'void *'. GCC and Clang give `void *` for this, but something like `float *` and `int *` do not fit the constrains of the operator. Cheers, Miguel