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: Newline in constant string


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

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