From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25492 invoked by alias); 15 Feb 2003 22:06:00 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 25477 invoked by uid 71); 15 Feb 2003 22:06:00 -0000 Date: Sat, 15 Feb 2003 22:06:00 -0000 Message-ID: <20030215220600.25476.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Steven Bosscher Subject: Re: c/8927: Gcc give error for wrong line of C code. Reply-To: Steven Bosscher X-SW-Source: 2003-02/txt/msg00670.txt.bz2 List-Id: The following reply was made to PR c/8927; it has been noted by GNATS. From: Steven Bosscher To: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gp@qnx.com, nobody@gcc.gnu.org, gcc-prs@gcc.gnu.org Cc: Wolfgang Bangerth Subject: Re: c/8927: Gcc give error for wrong line of C code. Date: 15 Feb 2003 22:56:46 +0100 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8927 The same problem happens for g++, so this is not a C bug. c_lex() and c-parse.in:_yylex() return the right line number for the token. But bison looks ahead a bit and that causes the line number to advance as well. This is also why saving the line number in the "primary" production doesn't help: Before we parse primary:IDENTIFIER, we've already advanced the line number. So my guess is that this is a cpplib bug: It should not advance the line number until the previous token is accepted. Dunno how to attack this bug. Greetz Steven