[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



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
&gt; <a  rel="nofollow" href="http://www.ale.org/mailman/listinfo/ale";>http://www.ale.org/mailman/listinfo/ale</a>


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00604" href="msg00604.html">[ale] Quick gcc question</a></strong>
<ul><li><em>From:</em> freemyer-ml at NorcrossGroup.com (Greg Freemyer)</li></ul></li>
<li><strong><a name="00608" href="msg00608.html">[ale] Quick gcc question</a></strong>
<ul><li><em>From:</em> ale at FultonGreen.com (Fulton Green)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00610.html">[ale] /dev/ttyUSB0 question</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00612.html">[ale] OT: Re: Help for Father In Florida</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00608.html">[ale] Quick gcc question</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00609.html">[ale] Updating a RH9 server...</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00611"><strong>Date</strong></a></li>
<li><a href="threads.html#00611"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>