Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp4857652ima; Tue, 5 Feb 2019 02:26:59 -0800 (PST) X-Google-Smtp-Source: AHgI3IbMJ9/+BdbDyh+BBIjKkH35zjaRpHaESTCa3n24dJ+DLbzuk+5P3Pqd9aY1kP5lJlIPOHTj X-Received: by 2002:a63:cc12:: with SMTP id x18mr3834629pgf.33.1549362419685; Tue, 05 Feb 2019 02:26:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549362419; cv=none; d=google.com; s=arc-20160816; b=duktXrEJnrKcBqDERx/CsenC3PKYkuGNOBEajgSqmDGrM76g8XkHFbMqsMIzk30VK5 VzB07aZK04ZxSrZZiOhg0aEH50vRtt+QptFoKH/0eDY59LZkvyseR+OOhTqZRYiQUcQZ cygQXbeMHD4OAhrQxe0z5L9MjiaOjTL1gbhCpW6J7Fv0DOV59rE3aOEhnxQC58pAlKhy PCzQ+R7Dlp7Qw3CtVfSMocS5kH6P54wHF4H5SKi37/Fz9Vunp6TF7erchlJZ0t1ioqo5 XoPybuEUNN90SjeHReLUQdr+BoTsZhkSJ0jUGV2+x73fl7eKtG6uKj0Ag5JOEua2WgFo 7mxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=MDQaSgo9RFUC6aKcABQ9zrrA/Y8eMDFicXTCHyOj2Ak=; b=oUkt8EcmH29l9Elvy2WZE3fWnKStqjQP01MlzAjExoLAASn4zKSh1o1C7nl8N1LT4B 7FeZhfJi9NE9WTUwZ5weOlNK144cZtlrKnpFFqGrsmf3WsvFlF/0BtECfw8LUTOOKbjU JFn5q0P5N5AC75PDfE1nX2FdoH+0FgkMasUsgHwOQvQfCQ244MQfJ5TrgRgNkVzlvzik +vFu79Jr084iPWZrpcFOz0KTbkEv0iLZrdzH4Z77zERMZI3EO6coFUrAgHSSEpuclri/ vwcwSFO+eeybOKWR2lMFBwcYnkWjv2IvYYy/eK6jp9A3v8mVaF/fW9frzu2o5bYkuHwT kySw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=Pxs1UWNi; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j187si2568945pge.151.2019.02.05.02.26.44; Tue, 05 Feb 2019 02:26:59 -0800 (PST) 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=@rasmusvillemoes.dk header.s=google header.b=Pxs1UWNi; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728084AbfBEJxj (ORCPT + 99 others); Tue, 5 Feb 2019 04:53:39 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:42944 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727138AbfBEJxf (ORCPT ); Tue, 5 Feb 2019 04:53:35 -0500 Received: by mail-lf1-f65.google.com with SMTP id l10so2125676lfh.9 for ; Tue, 05 Feb 2019 01:53:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=MDQaSgo9RFUC6aKcABQ9zrrA/Y8eMDFicXTCHyOj2Ak=; b=Pxs1UWNitC69iwUPhh9mTRzICcrHoC414ovC44wShfd8VBej1ZmbaqMEQFKPK58dOq eBSK4yojVpnGtnWO+8pITtVCwSlOW+S4lKbgHyJDAu9UNPFh3BNDCUE4+LXGdxa+hq2k CfXM2yZLe9+JZstkHfQqfQhsKCXS3J4ATyf+4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=MDQaSgo9RFUC6aKcABQ9zrrA/Y8eMDFicXTCHyOj2Ak=; b=nhUWoyMs8cAP1se/9143P1h7Pc50wtWA3Gon5UFiOvLv3RvnSketMCyCBzdo4JqMts Z8j/kuxTJxIb98p4oIBbvZRz2sRooME5X7467eMCW+2O1eJl34d4mgMCN9zBrfw+EOd9 pNl9im9z2ju1Lxi7hzKmVHDX1HxpOxbC3DrUPujlqce0q64OEEiuF7cTWm6loatAnut9 shubRaD9MXaGkePPQHDA6Q45aH7sLQrMzyNw6amz335qmENzEqYKKS5yuaS/cRKIU6yT 9nzBa2LxpOdw/vOYXsg8G/CKwgOn/a2FA1o+qJ84r8A4rAwSye10SkwpTFw1ZFWCf0XW thyA== X-Gm-Message-State: AHQUAuYVkzomCG5bC1It8TV5AwunuElijp/xgtvivyBjh7SidXWVWEz3 AEFAFVlTGvBdSSEU/7DZ4CbSUwBaRwOq4mKP X-Received: by 2002:a19:a345:: with SMTP id m66mr2577989lfe.84.1549360412961; Tue, 05 Feb 2019 01:53:32 -0800 (PST) Received: from [172.16.11.26] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id b128sm3689992lfe.91.2019.02.05.01.53.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Feb 2019 01:53:32 -0800 (PST) Subject: Re: [PATCH] build_bug.h: add wrapper for _Static_assert To: Andrew Morton , Kees Cook , Nick Desaulniers , Masahiro Yamada , Luc Van Oostenryck , linux-kernel@vger.kernel.org References: <20190203192401.29170-1-linux@rasmusvillemoes.dk> <20190204150916.f29d782b27f096e6c4c6d6cf@linux-foundation.org> <20190204151209.d6fae2c6466cb5c9c5814fd9@linux-foundation.org> From: Rasmus Villemoes Message-ID: Date: Tue, 5 Feb 2019 10:53:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190204151209.d6fae2c6466cb5c9c5814fd9@linux-foundation.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/02/2019 00.12, Andrew Morton wrote: >> >> It would be (very) nice to actually use this macro in a few places so >> it gets its build testing while in -next. > > ie, just about every BUILD_BUG_ON in mm/ could use this. Let's switch > a few? > Perhaps, but some make sense where they are, e.g. when iterating over two arrays using one iterator variable, it's fine to assert they have the same size just above the loop. And, unfortunately, static_assert() is not quite a drop-in replacement for BUILD_BUG_ON even when the argument is an ICE due to -Wdeclaration-after-statement. I'll fix the two BUILD_BUGs I know I've added over the years (one in vsprintf.c, one in fs/namei.c). Rasmus