[Bug preprocessor/20262] __LINE__ implementation flaky.

neil at daikokuya dot co dot uk gcc-bugzilla@gcc.gnu.org
Tue Mar 1 23:36:00 GMT 2005


------- Additional Comments From neil at daikokuya dot co dot uk  2005-03-01 23:36 -------
Subject: Re:  __LINE__ implementation flaky.

neil at daikokuya dot co dot uk wrote:-

> 
> ------- Additional Comments From neil at daikokuya dot co dot uk  2005-03-01 23:13 -------
> Subject: Re:  __LINE__ implementation flaky.
> 
> pinskia at gcc dot gnu dot org wrote:-
> 
> > 
> > ------- Additional Comments From pinskia at gcc dot gnu dot org  2005-03-01 17:16 -------
> > Outer Macros are expanded before inner ones and they get all placed on one line so this is invalid.
> 
> Huh? This is a bug.

Actually I take that back - I think you can say that the wording
of the standard is sufficiently vague that this is not a bug, and
may even be correct behaviour.  The standard says that (at the time
of expansion) it's the "presumed current source line of the file".
Since expansion happens after argument collection, it's not hard
to argue that the current source line of the file is constant for
both __LINE__ tokens.

Neil.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20262



More information about the Gcc-bugs mailing list