[ale] Quick gcc question
Greg Freemyer
freemyer-ml at NorcrossGroup.com
Thu Jul 22 14:59:24 EDT 2004
I changed the code. It turned out to only be a few places.
Thanks.
On Thu, 2004-07-22 at 14:28, Fulton Green wrote:
> On Thu, Jul 22, 2004 at 02:06:32PM -0400, Greg Freemyer wrote:
> > I'm trying to compile some code with gcc-3.3.3 that has some multi-line
> > strings.
> >
> > What gcc argument is needed to enable the multi-line strings?
> >
> > >> Example code that fails
> > printf (_("\
> > Copy a file, converting and formatting according to the options.\n\
> > \n"));
> > <<
> >
> > I'm getting the error:
> >
> > dcfldd.c:326:17: missing terminating " character
>
> A better way to do it, if you have the option of changing the code, is to
> write the strings like this:
> printf ("Copy a file.\n"
> "Then use it.\n");
> That's the ANSI-standard way of doing things, which is roughly how GCC
> compiles by default (the -ansi and -pedantic switches ensure near-100%
> checking for ANSI compliance). Note that the whitespace before the
> second line has no bearing on the string literal that GCC creates
> internally.
>
> The older way, which is what your code is showing, is indicative of the
> Kernighan & Ritchie (or "K&R") syntax used in the initial releases of C,
> before the C standards committees came on the scene. If changing the
> code isn't an option, use the -traditional switch.
>
> HTH
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
More information about the Ale
mailing list