Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp476366rdb; Fri, 6 Oct 2023 08:51:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFfpYRUfw+zDRStGh0ykieZt5Sx0Z8rNB/UqQPf3fRjnljkA4RXD5ju+Zr3CLWOlRjfiZx8 X-Received: by 2002:a17:90a:f195:b0:273:e64c:f22e with SMTP id bv21-20020a17090af19500b00273e64cf22emr7795226pjb.29.1696607489494; Fri, 06 Oct 2023 08:51:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696607489; cv=none; d=google.com; s=arc-20160816; b=DI9AT6TBooN3yZbMt+p77w+CqUJxCKQb+UHrGunjXOCpE8lUqp3THBTtDPq4/Hz/fH lk55OlYo2ZTnyVnCOewBZYZ5LDl6ut7Jgblj92e4NBsRKb+tCHDjHvQFMTvnUI9cPZrd UYXRfT3Cb6XSoRqThDmSC7rVWwnHn1rQ8/iVteNhEqF4s7TSceUBKZVXCDrMkzaiFLHh FT4levC2k/s4Pfx0OYWlF28ZrQ4iF5Ez5shE+mBZiaKzq5foYUs0cM5OxrLjxtW9G143 TrpwNO6wQDScjJ81leeK0VSutPO5FROaLcTnyfX3m6TcJ3EkNCYAZ4/QxtmRoiAE6mRb psjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=pmtk/y9ZFWXoVQtTZ+9Sxp75cydx8j2u8k6JTqRhxDs=; fh=G3M67iQG9WRt+PqHbrIkTHXHAXxXHp5M5aHUXzdV4W4=; b=pd/1Yt0NFG525i3pIcjQ/SnII58wjTCjiq3zcvl3dffh2LvVN8qA67vkLeuvhwbexW gPw+oBqnUPFfcvP7+XQBcWGg22uFdYNFKpb5BashDgONXZ7oGWfAkPJsh1oSrOYR/txB yvy2FqRv/ctvS2QM0gVwCkR+xOlu3LFxNzEnHGINLAAESxgDX+UjN7441yvBQDFRc+l4 bHEf7Ut8RF9lD1+35VGv5soGIj2YeOMUGiYJCcUwGXenfD2E5VuEL5J00l7CkV5g4PdZ IXCnIUmFp909xaDxztYSh6q/6vPxnWM5ev6/QabaOE1uSBksoXROkNeqzL/bEC4ndgKs zmPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id u18-20020a17090abb1200b002792c288cb7si5966397pjr.131.2023.10.06.08.51.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 08:51:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 7B3ED820B8FA; Fri, 6 Oct 2023 08:51:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232896AbjJFPvQ convert rfc822-to-8bit (ORCPT + 99 others); Fri, 6 Oct 2023 11:51:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232888AbjJFPvO (ORCPT ); Fri, 6 Oct 2023 11:51:14 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1916AB9 for ; Fri, 6 Oct 2023 08:51:11 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-166-Eb7wJLAQNCuk2F_0YS58DQ-1; Fri, 06 Oct 2023 16:51:07 +0100 X-MC-Unique: Eb7wJLAQNCuk2F_0YS58DQ-1 Received: from AcuMS.Aculab.com (10.202.163.4) by AcuMS.aculab.com (10.202.163.4) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Fri, 6 Oct 2023 16:51:06 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Fri, 6 Oct 2023 16:51:06 +0100 From: David Laight To: 'Kees Cook' CC: "linux-kernel@vger.kernel.org" , "'linux@rasmusvillemoes.dk'" , 'Steven Rostedt' , "'bvanassche@acm.org'" , "torvalds@linux-foundation.org" , "Nathan Chancellor" , Nick Desaulniers , Arnd Bergmann , "akpm@linux-foundation.org" Subject: RE: [PATCH v2 next] compiler.h: Move __is_constexpr() to compiler.h. Thread-Topic: [PATCH v2 next] compiler.h: Move __is_constexpr() to compiler.h. Thread-Index: AQHZ96gTRq31SBDNvUGrpdwig3TLHLA8553w Date: Fri, 6 Oct 2023 15:51:06 +0000 Message-ID: <321c3c0984e64e9cbd1b034755611710@AcuMS.aculab.com> References: <2a6680bbe2e84459816a113730426782@AcuMS.aculab.com> <202310050921.F0B15702D4@keescook> In-Reply-To: <202310050921.F0B15702D4@keescook> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 06 Oct 2023 08:51:27 -0700 (PDT) X-Spam-Level: ** It can also be defined more portably as: #define __is_constexpr(x) \ _Generic(0 ? (void *)((long)(x) * 0) : (int *)0, int *: 1, void *: 0) Which doesn't rely on 'sizeof (void)' being valid. But that is for another day. There is also: #define is_pointer_type(type) __is_constexpr((type)1) David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)