This is the mail archive of the gcc@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: Preprocessor Problem?


On Sat, May 27, 2000 at 07:55:24PM -0400, linguist-gcc@rich-paul.net wrote:
> 
> 
> On Sat, 27 May 2000, Zack Weinberg wrote:
> 
> > On Sat, May 27, 2000 at 11:23:33PM +0200, Martin v. Loewis wrote:
> > > > I am attempting to port some c++ code that uses the following construct:
> > > > 
> > > > #define whatever(x) \
> > > > class _whatever_x { \
> > > >   void something() {} \
> > > > }
> > > 
> > > > For some reason, it appears that gcc does not accept backslash
> > > > escaped newlines in macro definitions?!?!?!
> > > 
> > > Sure it does. There is a chance that a Carriage Return character
> > > follows the backslash, so there is whitespace after the backslash,
> > > before the newline character.
> > 
> > ... in which case a development snapshot will work as expected.
> 
> Thank you both ... these files were indeed dragged from a dos machine, with
> their damn line endings intact.
> 
> I'm also pleased to know that the new version ignores this ... I've always
> thought that the best way to handle CR's in a text file was to ignore them
> intirely

It is slightly trickier than that.  \n, \r, \r\n, and \n\r are all
used as line terminators on platforms currently in use.  We have to
take care to handle them all equally.

zw

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