Newline in constant string

Michael Meissner meissner@cygnus.com
Thu Dec 28 21:03:00 GMT 2000


On Fri, Dec 29, 2000 at 03:11:11AM -0000, Dave Raggett wrote:
> When I wrote some codes like this
> char *MyName="I am Dave Ra
> ggett";
> 
> gcc will treat the string as "I am Dave Ra\nggett".so I think gcc should 
> give some
> warning in such case. e.g. "missing '\' in your constant string".

If you use the -ansi -pedantic switches, it will give you a warning.

-- 
Michael Meissner, Red Hat, Inc.  (GCC group)
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work:	  meissner@redhat.com		phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org	fax:   +1 978-692-4482


More information about the Gcc mailing list