This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: cpp generates wrong #line directives


On Fri, Sep 01, 2000 at 08:06:57PM +0200, Bruno Haible wrote:
> Zack Weinberg writes:
> 
> > (I hope this is machine-generated code I'm looking at...)
> 
> Yes of course. That's the purpose of having #line.
> 
> > So the #line is inside a failed conditional block and is therefore
> > ignored.
> 
> You are right. It's not a cpp bug. I didn't know that #line, like
> #error and #include, is ignored during #if 0.

Everything is ignored during #if 0.  (Except that we count nested #if
blocks.)  See C99 6.10.1, in particular paragraph 5:

	Each directive's condition is checked in order. If it
	evaluates to false (zero), the group that it controls is
	skipped: directives are processed only through the name that
	determines the directive in order to keep track of the level
	of nested conditionals; the rest of the directives'
	preprocessing tokens are ignored, as are the other
	preprocessing tokens in the group. [...]

zw

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]