This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Still having major problems with cpplib and imake
- To: Dave Brolley <brolley at redhat dot com>
- Subject: Re: Still having major problems with cpplib and imake
- From: Zack Weinberg <zack at wolery dot cumb dot org>
- Date: Fri, 12 May 2000 11:37:31 -0700
- Cc: Jakub Jelinek <jakub at redhat dot com>, Neil Booth <NeilB at earthling dot net>, gcc-bugs at gcc dot gnu dot org
- References: <20000512095625.O474@sunsite.ms.mff.cuni.cz> <391C032A.B5DFFA3C@redhat.com>
On Fri, May 12, 2000 at 09:12:11AM -0400, Dave Brolley wrote:
> Jakub Jelinek wrote:
>
> > But cpp does not honour whitespace, which is a bigger problem.
> >
>
> > make requires tabs at the beginning of lines, which are replaced by cpplib
> > with spaces.
> > Just do the diff between the Makefiles.
> > Is there something that can be done about it, or does imake work purely by
> > luck on all platforms using undefined cpp behaviour?
>
> Neil and Zack:
>
> -traditional preprocessors generally preserve all whitesapce
> verbatim, including whitespace in macro arguments. This should be
> easy for cpplib to do in open text, but harder in macro arguments
> due to the token-based representation. Tabs are rare in macro
> arguments, so keeping a count of the witespaces might be sufficient
> there.
I was planning to do best-effort reconstruction of whitespace using
the column number information stored with the tokens, once we get that
right.
Note this has nothing to do with -traditional, we'll lose the leading
tabs in both modes.
> #define cat(a,b) foo/**/bar
> #define foo 1 -
> #define bar 1
> #define foobar 1
>
> #if cat (foo,bar)
> should_be_compiled ();
> #endif
> #if cat (foo, bar)
> should_not_be_compiled ();
> #endif
Hmm... we get this wrong now, but we could get it right without much
effort. Just got to distinguish /**/ from ## a bit more.
zw