[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gcc 2.8.1
Tommy Andersen <tommya@post3.tele.dk> writes:
|> On Tue, 16 Jun 1998, Petr Stehlik wrote:
|>
|> >But I noticed something else - the gcc 2.8.1 reports errors on different
|> >line numbers than they really are. It's somehow related to number of
|> >#include lines in the particular .c file. You all don't have this problem?
|>
|> I've noticed that too.
That's a bug in the preprocessor, it does not correctly handle
newline-backslash sequences inside strings in macro expansions. The
following patch makes it work better, but is not completely correct.
*** cccp.c.~1~ Tue Apr 14 17:30:55 1998
--- cccp.c Tue Apr 14 17:58:42 1998
*************** handle_directive (ip, op)
*** 3926,3932 ****
= skip_quoted_string (xp - 1, bp, ip->lineno,
NULL_PTR, NULL_PTR, NULL_PTR);
while (xp != bp1)
! *cp++ = *xp++;
}
break;
--- 3926,3935 ----
= skip_quoted_string (xp - 1, bp, ip->lineno,
NULL_PTR, NULL_PTR, NULL_PTR);
while (xp != bp1)
! if (*xp == '\\' && xp + 1 != bp1 && xp[1] == '\n')
! xp += 2;
! else
! *cp++ = *xp++;
}
break;
--
Andreas Schwab "And now for something
schwab@issan.informatik.uni-dortmund.de completely different"
schwab@gnu.org