Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2204869pxy; Mon, 2 Aug 2021 23:43:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsOa5FMncvO4ceffp67f597DbRYrEr75q5pcy8tV/1SIMPeCcX5F7jBOtlGDXI5yKWJVt+ X-Received: by 2002:a17:906:4a51:: with SMTP id a17mr18766192ejv.435.1627973038021; Mon, 02 Aug 2021 23:43:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627973038; cv=none; d=google.com; s=arc-20160816; b=RUy9V+3S86Nc8D46FpgLaIeah7h6QgCVTsRY9n9zoy4ZWPGckmOBjjpmMfdHcXjkE/ 4WuoXKu5S6DDB2VvFtAvHS5NJTJdhHVJuYBvms11RpnaRjqaJVjp0Js8qJbJ5cxnbXq7 iFoRfdhSGSlAfo13KjKbuBIMwjKe3bBSjkOE6nAsHOGX/PlQGQy914TpJ+Td9UN3EkWh lYgDKwINCm+SU3ZYx5mo9uR1H7+6XRxLzQCKRdq0iUwvFP6T7XA74fEntHRy8Px9I4Jf aVPJmHNBs4RfIz5Up/K4lD32Z/gz4ynUvfo4gMwJlNIIdxGwFBOH1hhrcburBdeDJMXU ikCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=AOXfrDIBSrb8A0VQUvY+TBcWqM660sA1rmEZT8mFt0s=; b=R6b9MW97CuiyEcbcxUv1hKP710hd8RUCqwJt6kNHG6N3YhiLk9ZBPk0Rr8ur3MrwhG ytqaAOJ+NR0LcyNfbWZc34Vx+z6WV4VFYPL1VbNDdN/TEAuRvI6MW1wy72wMyg9fItjJ j536QD8dqwdFZfng5VG754+qu2c3rHUypgRIErsuXzBawAwUpqiIJ1bau/+k6hBxm7M4 EZuok+5IU067fJlngnZnAMruhrWBNTv9kLiOgAuZgJSBEBbiArMLp73Ro73pCmIcU63S F3d091QryFhTpqHvweB46mKKsi2IuZyUna0b+A0/1AnSU7x8mnqsCflhdqhd8zfjFcCM 8faw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JMZ1FFIn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id yw24si11920806ejb.52.2021.08.02.23.43.34; Mon, 02 Aug 2021 23:43:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JMZ1FFIn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233763AbhHCGmR (ORCPT + 99 others); Tue, 3 Aug 2021 02:42:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231386AbhHCGmQ (ORCPT ); Tue, 3 Aug 2021 02:42:16 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC413C06175F for ; Mon, 2 Aug 2021 23:42:05 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id nh14so16689700pjb.2 for ; Mon, 02 Aug 2021 23:42:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=AOXfrDIBSrb8A0VQUvY+TBcWqM660sA1rmEZT8mFt0s=; b=JMZ1FFInEUptalCSIejCN3MZUGHjikyvbOOtgsgW6ZRQpBohkY6r7m/nMwZZT35YEX orzqYiY7JOSJLCnZiUVzjoUVxOxYaEwgWVErNrB/rDzmDWJ1aU3i+k2GwHbYUm8vgOcB 8yMhHxI7J/TVOeuMWbBMjY+gvnzNrN0e02Kqs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=AOXfrDIBSrb8A0VQUvY+TBcWqM660sA1rmEZT8mFt0s=; b=CRWJOUvMwclDZaaqkYuCCVIPirrVZFLqD5wFQjcz5ZvC7kU3Yvv/o4F2wShmZqMO0E rpqg1qFl3M8n153D0YkMl+iPkRWtbhuq9t0wjCQ7kwQ1j7zGTFk5BDFBhuqQZ9RfmGkD Hyfr2iY6772fR2iadXRVLbwtsvgVJkjBJxBcjzVmm2XdQ165nyJ/NNNz0mPOdn9cPe8x e1T3e8JZ2HZ6QT0ZjBZio3Vc9ZqWwgyFfCqlqxyPfk3zs9gWLVVQbrjvHlGWHURosUdp bzfzkI2E0tIIzjJaj4nJz8TuaW2FdU/2kG0SkxJ6V8SXS2RQEMlbWTi7krX/3+kmLmxk yqMw== X-Gm-Message-State: AOAM531Vkz+joOfSc8O5zkjLR76tBznp9be808qE3O+8GfUceoG6pXN8 2kIhuGjlC22+JktrAVnJn7ILug== X-Received: by 2002:a63:f804:: with SMTP id n4mr1526796pgh.341.1627972925206; Mon, 02 Aug 2021 23:42:05 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id j25sm13953813pfe.198.2021.08.02.23.42.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Aug 2021 23:42:04 -0700 (PDT) Date: Mon, 2 Aug 2021 23:42:03 -0700 From: Kees Cook To: Nick Desaulniers Cc: Miguel Ojeda , Nathan Chancellor , Andrew Morton , Marco Elver , Masahiro Yamada , Luc Van Oostenryck , Arvind Sankar , Will Deacon , Sami Tolvanen , Arnd Bergmann , Ard Biesheuvel , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH v2] compiler_attributes.h: move __compiletime_{error|warning} Message-ID: <202108022341.BB8EEA7@keescook> References: <20210802202326.1817503-1-ndesaulniers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210802202326.1817503-1-ndesaulniers@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 02, 2021 at 01:23:20PM -0700, Nick Desaulniers wrote: > I'm working on adding support for __attribute__((__error__(""))) and > __attribute__((__warning__(""))) to Clang. To make use of these in > __compiletime_error and __compiletime_warning (as used by BUILD_BUG and > friends) for newer clang and detect/fallback for older versions of > clang, move these to compiler_attributes.h and guard them with > __has_attribute preprocessor guards. > > Link: https://reviews.llvm.org/D106030 > Link: https://bugs.llvm.org/show_bug.cgi?id=16428 > Link: https://github.com/ClangBuiltLinux/linux/issues/1173 > Signed-off-by: Nick Desaulniers I'm looking forward to having this working in Clang! :) Reviewed-by: Kees Cook -- Kees Cook