Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp644877lqg; Fri, 1 Mar 2024 17:18:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWIPa2EJ3rHDd4hNCBAg0W4Zil8kAfQhPgPETDNkx4yw5KIV2pMZUjLhhpDByPwWBGtjVirmvfJFK4dHnuzcQVyvCRQPtgidp+3esFPYg== X-Google-Smtp-Source: AGHT+IG9yqo8V8YXUEbhyC3rHlD2Y4iObv0HGZddi2O0rlFDa10+sBVxCmwMCT7mG0QaEji8iP3B X-Received: by 2002:a17:90b:68c:b0:29a:ce2b:7611 with SMTP id m12-20020a17090b068c00b0029ace2b7611mr3038396pjz.28.1709342337942; Fri, 01 Mar 2024 17:18:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709342337; cv=pass; d=google.com; s=arc-20160816; b=yWHDf+pTHRkBcEHdPXq1sifIzPhnpm5SJH9vfNfsXhA0N1D7+EXucErTZFJSdI8dqN BRvxA4E4f5Cxw+HWikqbm+66ncYoMiWIT2zQPHy4MhKkuOmXYE8odywGF18fvrW9Wlsz H6dGBh4VsKkkrw08fVoB74cV36Go7eqXiV/2ZK3QiYcd5+aYFw5xqtV4eu9CSL3Lwo6b IezRcsVcDgudM1X5Y/ui0eJ4og09STJ6XPwVo8ZB/rv8TcmsrnShWiAbHFfwllxy3b2t xDaNLcLaNmvavOKMWzhi4GRFUMR2pI2ETUdTQjvhn3wvb/2KE/seyB7wCxNvU5cjdbJw +I7g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:date:from; bh=/Sc7AZYDUhh9w7JBcRgoqKzcVAWfY10ucPjqHGHrAts=; fh=mwc+xRN3F2xMxvq77DaCS5FzJFDn082eKu5HNm89uC4=; b=in41WUxU6mmt4qg64tdzgQLC0xdmc9eBD19FBtWzGu7XiVlYzNdXMooJ789ArPtqA9 Xv60wPW3VS3q5mUpoOHzhQRmRruNUlMx1hdKxASjbMjZIQNwamWFIrMuf+91AKJjT56b +NH8macwS1i8Oi9BN3xqeoMIdiLi9jkmZQsawvzZyKOoBBdozB8LH0fficCIJSPzBwcu 9IGi1Q5akSpf3uaAxbPfASGgd8ztgcpKYbPi+wzAIm0r4P4feWkAJF5dkPKJ4Axd63on xWM27Wc1XzauNI1xctF5UnHlIvUJBgJFloCLlXeV7cL0kiWoLCDYQL3p2mC+clg/YM9H 49YA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-89289-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89289-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id c4-20020a17090a8d0400b0029af5b97e81si6491309pjo.6.2024.03.01.17.18.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 17:18:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89289-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-89289-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89289-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 3843AB2212F for ; Sat, 2 Mar 2024 01:18:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32E226AB9; Sat, 2 Mar 2024 01:18:46 +0000 (UTC) Received: from fgw22-7.mail.saunalahti.fi (fgw22-7.mail.saunalahti.fi [62.142.5.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 254732904 for ; Sat, 2 Mar 2024 01:18:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.83 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709342325; cv=none; b=VHzXPND1XYuTM2/MdNssSKrzluAqFX80dAL0qJ7ckWWe+VkOmmp+4HNObCsgY3fws3oz+l3i60YghNjKwjjkq2+DZErPeXqUCIgaSuX2osLeFqTF/bMSkRitAncjgOvwA+irkoYouZGbaSVDibvdrtVpxlf9tic1W27hZKLATvg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709342325; c=relaxed/simple; bh=m0IPqXx7Wg24y/7JRaaKK28MS12xs2UN/ny1kNF25Gs=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=u33DEIVjq4F/Fdt8v9FRgmeTt/eeTV30oyFlVQdMKUWmbRqYCD2ximIWBKNg/k2pdRr9SiMffqaKUsQ4iFvCPkQtOFCRg+6YzL3STstAau6D682Y/wvV6KCZoQBK43tXu/0GqjgCIYydkaXRpU5v+G4lMDyrfy992jKVwn3LbtE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-217.elisa-laajakaista.fi [88.113.26.217]) by fgw22.mail.saunalahti.fi (Halon) with ESMTP id a5064544-d832-11ee-a9de-005056bdf889; Sat, 02 Mar 2024 03:17:33 +0200 (EET) From: Andy Shevchenko Date: Sat, 2 Mar 2024 03:17:32 +0200 To: Kees Cook Cc: Rasmus Villemoes , "Gustavo A . R . Silva" , Miguel Ojeda , Jani Nikula , David Laight , Nick Desaulniers , Martin Uecker , Jonathan Corbet , linux-doc@vger.kernel.org, Miguel Ojeda , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] compiler.h: Explain how __is_constexpr() works Message-ID: References: <20240301044428.work.411-kees@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240301044428.work.411-kees@kernel.org> Thu, Feb 29, 2024 at 08:44:37PM -0800, Kees Cook kirjoitti: > The __is_constexpr() macro is dark magic. Shed some light on it with > a comment to explain how and why it works. I was under impression that somebody did it already once and it fell through cracks when has been moved (?) to compiler.h. Ah, now I see it, https://lore.kernel.org/all/YKeghxRY4FeOKuwb@smile.fi.intel.com/. It was asked, but till now never fulfilled (maybe Reported-by:/Closes: tag?). And explanation before was given here: https://stackoverflow.com/questions/49481217/linux-kernels-is-constexpr-macro. -- With Best Regards, Andy Shevchenko