This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: Preprocessing oddity breaks binutils
>>>>> "Andreas" == Andreas Schwab <schwab@issan.cs.uni-dortmund.de> writes:
Andreas> Thus the current behaviour of cpp is more in the spirit
Andreas> of the standard, and IMHO cpplib is wrong.
I disagree, but clearly the standard does not really specify behavior
here.
My original example indicates how hard it is to forsee what might
happen, given the current behavior. In particular, in a package that
has srcdir/objdir builds, if you have built once in the srcdir (or if
the package distributes generated files in the srcdir), and you then
build in an objdir, all yacc-generated files get the wrong header.
What you have yacc to to work around this problem? Generate #line's
that refer to the objdir, rather than the srcdir? But, that's not
where the source actually *is*, so then debugging wouldn't work. I
suppose you could insert a #line for the objdir right before
#include'ing the header, but why should you have to?
There's really no way to resolve this debate, so I don't intend to
argue the point any further. I'm happy to leave it in Dave and
Zack's capable hands!
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com