Re: [PATCH] gcc 3.0.1 warnings about multi-line literals

From: H. Peter Anvin (hpa@zytor.com)
Date: Mon Oct 22 2001 - 15:51:29 EST


Followup to: <20011022161527.K23213@redhat.com>
By author: Benjamin LaHaise <bcrl@redhat.com>
In newsgroup: linux.dev.kernel
>
> On Mon, Oct 22, 2001 at 01:05:10PM -0700, John Hawkes wrote:
> > This patch eliminates gcc 3.0.1 warnings, "multi-line string literals are
> > deprecated", in two include/asm-i386 files. Patches cleanly for at least
> > 2.4.10 and 2.4.12, and tested in 2.4.10.
>
> Please reject this patch. The gcc folks are wrong in this case.
>

It's not gcc even, it's C99 which are making these explicitly
deprecated. If you want a string literal which includes \n and are
mapped in that form, do either:

       "foo\n"
       "bar\n"
       "baz\n"

... or ..

        "foo\n\
        bar\n\
        baz"

I usually do the former.

        -hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt	<amsp@zytor.com>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Oct 23 2001 - 21:00:32 EST