Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3950733ybb; Tue, 31 Mar 2020 15:34:20 -0700 (PDT) X-Google-Smtp-Source: APiQypKH/h4jDhvgPoP3xmbS2bnnGXjZdz4Jcy4kKb7nhB1hvmxuRTqZXD9uu0jGweMY7tc+XwsB X-Received: by 2002:aca:cf0d:: with SMTP id f13mr810466oig.162.1585694059878; Tue, 31 Mar 2020 15:34:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585694059; cv=none; d=google.com; s=arc-20160816; b=Hppkwzkoc2WBdp5SkpdrBvRBUNlDqj8o/ncUwSu4bo9MS6NZjDjGOHa9VWIsNeA3C5 cVyMxEw/ixRd8kCw1kRrdpraYbnjcwYCBGwkQDuwvdmYmyxdAIV/5DWmrkw2Q3HeWIwO iUFfTsUtmKFFhsTWl8sSR1vQt/k6xhm3WOvMEku2yB1h/dlNaI1iIjJXp8ghXyjePO9w 7FF6WiCbaZweZrdclJugkWQ8D3BNa6UXJdqaMVi1UglbUPi8oG0C3FxRsCwOGqfsQ+Nk jvBf1RkEz/qOij/YKOSM4aYCGUl2yB49bX4t4XiIsW4Wj9sHN+fx7/q/33LEW0NShhPp JRHA== 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=UlF5/TKBo/syHEaCZCHsUFKOt6NSD5FVEK8vqIByTKE=; b=By+zAs4ojdLBxlBhbnskvDi6F9j/5On/0lXZmkyi+GlX5VR0VZFmHhdj9C7sSd5jHt SZox8L6X9SkIvhWVOB8HbAkClCVpwnQZKFTWjEqzGoveS1lYncWObw9qxE7y0OxByccN ePZ1lAWC21sAPvnC72Gu+CSg+MIrhJ4+l9Lxr4XJZFQa1L9xwLCOjIANqVKHv8heUc/g MhV/o91As8sQJUpbAiKRgAC6HUnFC1NVVX2uEFinUZAPR61gH8W7/qLY3N72ZisAhIEZ mexc9TwYnzkRq/h/yW7WdjnpDALHoUT/7uNwVxcRkvhnYrN18l9Wb8JBxAxCU4ns7wr5 zaGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pobox.com header.s=sasl header.b=dXRKPE5N; 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 z62si97197oiz.23.2020.03.31.15.33.56; Tue, 31 Mar 2020 15:34:19 -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=dXRKPE5N; 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 S1730556AbgCaWc0 (ORCPT + 99 others); Tue, 31 Mar 2020 18:32:26 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:62014 "EHLO pb-smtp1.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727955AbgCaWcZ (ORCPT ); Tue, 31 Mar 2020 18:32:25 -0400 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 9EB225E923; Tue, 31 Mar 2020 18:32:23 -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=ij8E2mP4qn59 jj81vTeQK6B7GHM=; b=dXRKPE5N4m7oXAcItLUINV5/aqGBbNL9+oXl1FMODExK j4cC6UHcXb9i2bFG2Sj19JpkR8aHIlskVH0wbLizueh/UA64CfMqz9tIqDyVIXZN Hr2EHeGpohsN493+2FHsCl9lnoAhc5t9IH7YCeUuG6+ZvUhUF6T7d+PTR92jg1A= 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=ikshDs vqIHah/bWJ1uWaMmIWWdFR8pcP3B3w20KKbAT8SH3CEdNn9T6xX5ZNW1+Q/Dndwm x1WY/CAv5Z66KQeIJpGdYxSAdCBxqFur9tboO1FiGDVoX38mEJI1kIMNZOCoBSML Hih51i3nhK/SX3fkHxvHMtxwhgxF4+qgTj/ps= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 955CA5E922; Tue, 31 Mar 2020 18:32:23 -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 64C775E921; Tue, 31 Mar 2020 18:32:17 -0400 (EDT) (envelope-from daniel.santos@pobox.com) Subject: Re: [PATCH] compiler.h: fix error in BUILD_BUG_ON() reporting To: Rasmus Villemoes , Joe Perches , Vegard Nossum , Andrew Morton Cc: linux-kernel@vger.kernel.org, Rasmus Villemoes , Masahiro Yamada , Ian Abbott References: <20200331112637.25047-1-vegard.nossum@oracle.com> <123d3606-cebf-4261-4b04-7d53d1fcdb07@prevas.dk> From: Daniel Santos Message-ID: <7acde2e5-60dd-f384-fda7-1d018608f8e7@pobox.com> Date: Tue, 31 Mar 2020 17:30:30 -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: <123d3606-cebf-4261-4b04-7d53d1fcdb07@prevas.dk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US X-Pobox-Relay-ID: 7D88B43C-739F-11EA-BD69-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 1:56 PM, Rasmus Villemoes wrote: > On 31/03/2020 20.20, Joe Perches wrote: >> On Tue, 2020-03-31 at 13:26 +0200, Vegard Nossum wrote: >>> #define compiletime_assert(condition, msg) \ >>> - _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__= ) >>> + _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTE= R__) >> This might be better using something like __LINE__ ## _ ## __COUNTER__ >> >> as line # is somewhat useful to identify the specific assert in a file= . >> > Eh, if the assert fires, doesn't the compiler's diagnostics already > contain all kinds of location information? > > Rasmus Yes, the diagnostic contains the file name and line in a far more useful format that every IDE knows how to read.=C2=A0 __LINE__ is only used for uniqueness and was chosen when __COUNTER__ (introduced in gcc 4.3) was still somewhat new. Daniel