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: Still having major problems with cpplib and imake


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.

This has an effect on input like makefiles, but it also has a semantic effect. Consider

#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

Hey -- I just report my experience. I didn't design it  :-)

Dave


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