Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp89262ybb; Tue, 31 Mar 2020 17:56:10 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvdIepV3GFnG8FrXL1HGeSwb7KqjDI8GskJP2gmYKYBMm0436SAhRE/HA/hJpygd/Og1/pJ X-Received: by 2002:a4a:3357:: with SMTP id q84mr15243517ooq.69.1585702569525; Tue, 31 Mar 2020 17:56:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585702569; cv=none; d=google.com; s=arc-20160816; b=IuiUj3AymI0axSWMtHm19pe31cBwkcHgnkYL+YNf4fRL402f5cUKnX/zyZ3TPOJSN9 amY52uO2qFg6u8osW5W1eFdUWR1QMoTyh+GGxrP8nHiSJ4TDuKvEzb1CScNsX/3MYRZw GKeJnV04HHkMyuqqGSCara6CiAK73vTlAJLxVB9jeJiX1tsibOllqdpQtp6DJReanFOM 1sp7e8ZiKVIgTMklxD/ZmQiWJ1zVlP+NwbEKIZ1o62chsyY0b3yoU38eR8uq8SisTBNC sPrnaSLcJ2ov432CrEmmhVhfX5kcT2QbFoWMB+QqA5viHaZFJETOcEpHRUNRU6KNwwNT S1Ig== 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:cc:to:subject:domainkey-signature :dkim-signature; bh=MauGGBR1GdDqRqTKfGYje4WAO47hdlbOHzbRwLcgUds=; b=mqkk0zUAOxGSCkAkP0f5HtywdBWvyKkSZFiXtbH8fnvAGHKbM+i56WdwQFAib/KkP1 tYURz55isDlX0BSwFkMP89rJbjX9DDwjN1AGtdL4s1pTWA78ZxlITXCd4IdXJyQOJAuB HwY904MIxieJlhal6GkZvC13sp6BstcPWYmyqX90cpin9QbbMCtZ6MMkPmsQTt6dHLnY nXvuxHOZV+DytWDZZqfcOboZTt/stlu7BqMoZbhHnenzfxunJiJS7eOHi5fllVqIHr7+ +JfDy7UranzW7Ag3jrX4mT0TuesO+e+/i+otUmEQngn0L9gZhZ9QYJaXV0Gb0X7YRXvB BAOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pobox.com header.s=sasl header.b=M2JhvCc+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=pobox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 63si118375otm.66.2020.03.31.17.55.57; Tue, 31 Mar 2020 17:56:09 -0700 (PDT) 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=@pobox.com header.s=sasl header.b=M2JhvCc+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=pobox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732271AbgDAAzk (ORCPT + 99 others); Tue, 31 Mar 2020 20:55:40 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:57458 "EHLO pb-smtp1.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732260AbgDAAzk (ORCPT ); Tue, 31 Mar 2020 20:55:40 -0400 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 009CF5F754; Tue, 31 Mar 2020 20:55:38 -0400 (EDT) (envelope-from daniel.santos@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=subject:to:cc :references:from:message-id:date:mime-version:in-reply-to :content-type:content-transfer-encoding; s=sasl; bh=6Ba61ozdW2ME LOxHcef0GuJg9c8=; b=M2JhvCc+9B2kpneG9lvLE1eGQAei6ud+gSPA3e/lbYks 8cN1y4+oAC6Z4CBbo0fCjRDbtD+oe3QD2WD2O5A2PO2O2yVOvn2a3jj6lY4iDAUT Fv7puagSxG+isEymArxt00AxfusJYZPiSFz7BuZ0FvwPE801o7dC5+0m7eMoA5s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=subject:to:cc :references:from:message-id:date:mime-version:in-reply-to :content-type:content-transfer-encoding; q=dns; s=sasl; b=s55EjS +lK/gKaaXKg73GamDej40JdmwryHyqVSBh0Yr7r7ELKeid1vkG8NmS+s00Kb4zmu CHzt5lbO0KvitmG1Jy75S8rIY48cD6ABX9cY5EJtcyc3Q802EHbtnv5wGr3JKHSv qfs887/+nqhpiUT/1q2JeD+V28gmbNzmQ44Z8= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id EB7515F752; Tue, 31 Mar 2020 20:55:37 -0400 (EDT) (envelope-from daniel.santos@pobox.com) Received: from [192.168.0.8] (unknown [76.183.130.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 4E4445F751; Tue, 31 Mar 2020 20:55:35 -0400 (EDT) (envelope-from daniel.santos@pobox.com) Subject: Re: [PATCH] compiler.h: fix error in BUILD_BUG_ON() reporting To: Nathan Chancellor Cc: Vegard Nossum , Andrew Morton , linux-kernel@vger.kernel.org, Rasmus Villemoes , Masahiro Yamada , Ian Abbott References: <20200331112637.25047-1-vegard.nossum@oracle.com> <91730318-da0e-c992-f154-a74044b26650@pobox.com> <20200331223638.GA53668@ubuntu-m2-xlarge-x86> From: Daniel Santos Message-ID: <88a1f7e9-596b-1973-a122-b90ef5a36af4@pobox.com> Date: Tue, 31 Mar 2020 19:53:45 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <20200331223638.GA53668@ubuntu-m2-xlarge-x86> Content-Type: text/plain; charset=utf-8 Content-Language: en-US X-Pobox-Relay-ID: 802654EC-73B3-11EA-8093-C28CBED8090B-06139138!pb-smtp1.pobox.com Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/31/20 5:36 PM, Nathan Chancellor wrote: > On Tue, Mar 31, 2020 at 05:25:38PM -0500, Daniel Santos wrote: >> >> This will break builds using gcc 4.2 and earlier and the expectation w= as >> that you don't put two of them on the same line -- not helpful in macr= os >> where it all must be on the same line.=C2=A0 Is gcc 4.2 still supporte= d?=C2=A0 If >> so, I recommend using another macro for the unique number that uses >> __COUNTER__ if available and __LINE__ otherwise.=C2=A0 This was the de= cision >> for using __LINE__ when I wrote the original anyway. >> >> Also note that this construct: >> >> BUILD_BUG_ON_MSG(0, "I like chicken"); BUILD_BUG_ON_MSG(1, "I don't li= ke >> chicken"); >> >> will incorrectly claim that I like chicken.=C2=A0 This is because of h= ow >> __attribute__((error)) works -- gcc will use the first declaration to >> define the error message. >> >> I couple of years ago, I almost wrote a gcc extension to get rid of th= is >> whole mess and just __builtin_const_assert(cond, msg).=C2=A0 Maybe I'l= l >> finish that this year. >> >> Daniel > No, GCC 4.6 is the minimum required version and it is highly likely tha= t > the minimum version of GCC will be raised to 4.8 soon: > > https://lore.kernel.org/lkml/20200123153341.19947-10-will@kernel.org/ > https://git.kernel.org/peterz/queue/c/0e75b883b400ac4b1dafafe3cbd2e0a39= b714232 > > Cheers, > Nathan Thank you Nathan.=C2=A0 In that case this is definitely what we want now. Reviewed-by: Daniel Santos Cheers, Daniel