This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [distcc] gcc bootstraps with distcc


On Aug  5, 2003, "Zack Weinberg" <zack@codesourcery.com> wrote:

>> What should __LINE__ expand to i both cases?

> 6, 9.

> To first order, if __LINE__ does not expand to the number of the line
> it actually appeared on in the source file, that is a bug.

I guess I'll leave this one for you cpp folks to figure out :-)

> If the macro invocation extends over multiple lines, then the right
> answer is debatable.

I guess we have to make a call and figure out whether we want to
make the behavior we have in the separate or the integrated
preprocessor apply to both.  When my patch went in, it introduced a
change in the separate preprocessor, in such a way that it agreed with
the current behavior regarding macro expansion.  We might as well
revert to the previous behavior of the preprocessor, and change the
integrated preprocessor to agree with it.  I don't care either way,
and I don't want to get into yet another debate :-), I just want the
two preprocessors to agree.  So...  What should it be?  (of course I'd
much rather only have to tweak the testcase and leave the patch that
went in alone than revert it, patch the integrated preprocessor and
tweak all testcases that might assume the then-wrong notion of line
number such that they agree with the change in the integrated
preprocessor.

We actually have a third option: if a macro invocation spans multiple
lines, we could keep the expansion of the macro in the initial line,
and resync line *and* column at the end of the macro expansion.  I
actually tried to do it, and found it tricky, so I could use some
help.  I can post the details about the difficulty I run into (or at
least as much as I remember :-) if you find this option would be
interesting.  Just to be very clear, this means we'd expand:

#define FOO(x) x
a FOO(
b) c

to

# 2 "filename"
a b
   c

if there's no line break in the macro, we wouldn't introduce an
artificial # line and blanks just to resync columns, although we might
as well do it if requested.  I'm not looking forward to implementing
this option, though :-)

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


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