From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C5F413887010; Wed, 8 Apr 2020 20:33:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C5F413887010 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1586378034; bh=Jwy3mCY/C9P2QMZHPEJJKZIldPNobF5tZlvO+z2W5vk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=tP3tqlRwwMzM1W9WTv8Wb3r6JtIa+G6FQwcEfIZOvao4KzMrDsRp7oM/S4op/ToND miW98fSbxhJHhKvEAi/5qHw93NMa++Ks7x15aK01f8p0lPyxOQsOz/rbPchS4eKb9v IFx8VWdNkDawUSF6Yp7tHapLJLHRKFTbLINZvt2A= From: "alisdairm at me dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/94535] __LINE__ value changed for funciton macro invocations spanning multiple lines Date: Wed, 08 Apr 2020 20:33:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: preprocessor X-Bugzilla-Version: 9.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: alisdairm at me dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2020 20:33:54 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94535 --- Comment #2 from Alisdair Meredith --- Thanks for the speedy response, really appreciated! I believe this is well-defined behavior, but can accept that the value of __LINE__ may be unspecified - I do struggle with pre-processor wording. There is no multiline "macro function" here, there is an invocation of a ma= cro, and the invocation spans multiple lines. Our actual use case looks more li= ke: INVOKE_MACRO(ARG1, ARG2, ARG3); Where the line-wraps are forced by coding convention and line-length limits= .=20 This is not a control-line that defined a macro, so I believe the token sequence is taken after discarding irrelevant whitespace. The issue is whe= ther __LINE__ should correspond to the line with the opening paren, the closing paren, or one of the lines in-between. Until gcc9, AFAICT, all compilers agreed on the line with the opening paren. Even if it is unspecified behav= ior (so free to choose) it would be helpful to preserve a compatibility with pa= st gcc compilers, and all other tested compilers, unless there is a strong rea= son to want the change. If there were more compiler divergence on the issue, I would be less concerned.=