Wrong multi-line string warning

Neil Booth neil@daikokuya.demon.co.uk
Mon Mar 5 10:54:00 GMT 2001


Hi Andreas,

Andreas Jaeger wrote:-

> I get this warning in glibc with your cpp patch:
> 
> ptestcases.h:125:27: warning: multi-line string literals are deprecated
> ptestcases.h:140:27: warning: multi-line string literals are deprecated
> 
> I don't think the warning is valid, the strings contain only ctrl-M.

The newline seems to have been stripped from your file; maybe by some
random mailer.  I found the file in my local copy of glibc, and it does
appear to be a ctrl-M.

My understanding is that ctrl-M is the same as \r.  We treat that as
a newline for compatibility with DOS, MAC etc.  So if that is the case
with your text file, CPP is correct, and CPP was never doing what you
want anyway - CPP replaces all 4 forms of embedded newlines that it
recognises with a single \n.  To avoid this, and be testing what I think
you thought you were testing, I suggest you use \r in your text file.

Does this make sense?

Neil.



More information about the Gcc-bugs mailing list