This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Newline in constant string
- To: Dave Raggett <dave_raggett at hotmail dot com>
- Subject: Re: Newline in constant string
- From: Michael Meissner <meissner at cygnus dot com>
- Date: Fri, 29 Dec 2000 00:03:09 -0500
- Cc: gcc at gcc dot gnu dot org
- References: <F13utSgcOrBLSAQV6uP0000ac05@hotmail.com>
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