Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp108887ybb; Tue, 31 Mar 2020 18:22:36 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt2RODIQNHIBCqiQ6VAys7NPpLpNcG+AfD1Bc4UwiBsx9l6+II60yyi+Ltlxl8m4D4F0eqd X-Received: by 2002:a05:6830:22d9:: with SMTP id q25mr14630368otc.164.1585704156097; Tue, 31 Mar 2020 18:22:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585704156; cv=none; d=google.com; s=arc-20160816; b=sXqg9iDRTX3UaAmimY8InYQ1aO6rySLiit2hqhG/1xVi0aea0xEdAv+EYgfvsFMhs/ u9oRgxTlsDrCqNXBVrCQFLZXrtd6g5388NGqooP1boqzBEEIbHFm2cQBy2x3v0wForBz coZhkPahV9H91wdkmVgkASnMPhrRuO9tWcUd04xIJ8597L6GiIQI4QZ+uxliPiwb8YCm Tgc/qYgFTB8l85h0VqM9rVrCSW+OxsmPwK5VmHhfDyjEzo+HgEkuP3zojYMaiqw2Mitn um4+oU6NwrpgkiDO2kH/vjMnLHckT5NtPqEnoZmDCqCwUHyoBRqcvQBJ2vBTQl3y9/Vs hRRw== 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=jxAPiOvUH9WCf9bzs67jo0zIEYtNEVLntxsQOlb/hfM=; b=B/OPbDF+6mp/OMSMzMC+E0D8THL/lWvv6sIFyeYXKKTsF0i7f6EyxZ/v2wPzLKDrO3 WclNWgXmUqrD/Qa3n1anKBG237zMjSJfwczs4hjiXi4qKgztnll4G/Zt2Dn2T9uuGjkb ZFgw1i8LlPk3AmNL/uwixcEEsIhh9wcL0gYhPCfRC0vLsqpBLH41nGRoonxqDtT7PpLc KqPMdav5D7t05ncjHNYfVFKsBzEPsVsCojnHMTOVAXScfCKyciCrKm8yom0sdE1ld/xW kip09eXVK/qLomXx2TdPClTNoqRn5/dk0/0DDrWxvpqUohVpfWK4oOG5HN9mJIiMfUUF Qm5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pobox.com header.s=sasl header.b=bZT2zMyZ; 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 u9si256808oia.62.2020.03.31.18.22.21; Tue, 31 Mar 2020 18:22:36 -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=bZT2zMyZ; 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 S1731654AbgDABO0 (ORCPT + 99 others); Tue, 31 Mar 2020 21:14:26 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:51870 "EHLO pb-smtp1.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731470AbgDABOZ (ORCPT ); Tue, 31 Mar 2020 21:14:25 -0400 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 8425F5F88E; Tue, 31 Mar 2020 21:14: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=CDrTBsI/C2cd 72MmvNIWAUzbW2k=; b=bZT2zMyZNVdO/oLMGv6sskK/RxaaNbn77dsMRR9jrkc7 JGSBOF7quTj7xvmnQXu+ojSPQaUdPTEOSGLq8tHIaCqlVozDA5a7sPMPVPdWGwtW 7p0MpXx5fSFq9imBXUTRIcjRApgi+zayR1mWlfcJxklLPh5lPFIyI5aXuKiNIiM= 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=wWIDYw aGvnQpkcU9WoqnQXo+F9c1W/1GvhVMJ8lMKanKCrIJGd194jy6+PWHGWt+wVHNKI RbB6m9bc9JOGiyTQTtC60z8FXt8r6vTpySqGGyJqZaGxIppbSr8EERXGmFfcYWxw onk5xlz3ljD87GAsJRC7ar85H86bQN9ZSmuXU= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 7B9F65F88D; Tue, 31 Mar 2020 21:14: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 3C8B65F88C; Tue, 31 Mar 2020 21:14:20 -0400 (EDT) (envelope-from daniel.santos@pobox.com) Subject: Re: [PATCH] compiler.h: fix error in BUILD_BUG_ON() reporting To: Vegard Nossum , Joe Perches , Rasmus Villemoes , 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: Date: Tue, 31 Mar 2020 20:12: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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US X-Pobox-Relay-ID: 1F02B496-73B6-11EA-B06B-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 2:08 PM, Vegard Nossum wrote: > > __LINE__ is only used currently for creating a unique identifier, as fa= r > as I can tell. > > The way it works is that it creates a function declaration with the > attribute __attribute__((error(message))), which makes gcc throw an > error if the function is ever used (i.e. calls are not compiled out). Back before __attribute__((error())), these macros used to just declare a function that isn't defined and you only got an error at link-time -- the line number did matter then.=C2=A0 Then there was the negative array index thing. > > The number does appear in the output, but it's not even really obvious > that it's a line number. And the compiler's diagnostics are pretty good > at showing the whole "stack trace" of where the call came from > (including the proper line numbers). > > > Vegard And the stack trace used to be useless without -g or -g3, but I believe gcc gives the macro expansion back trace without it now.=C2=A0 But imo, t= he macro expansion back trace is a lot of noise that we can eliminate with a direct gcc mechanism to break the build on some __builtin_constant_p() expression. Daniel