This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: warn/croak on "string" "string" auto-joins
- From: "Dave Korn" <dk at artimi dot com>
- To: "'Paul Koning'" <pkoning at equallogic dot com>,<dewar at gnat dot com>
- Cc: <zack at codesourcery dot com>,<haircut at gmail dot com>,<gcc at gcc dot gnu dot org>
- Date: Wed, 18 Aug 2004 19:02:56 +0100
- Subject: RE: warn/croak on "string" "string" auto-joins
> -----Original Message-----
> From: gcc-owner On Behalf Of Paul Koning
> Sent: 18 August 2004 14:10
> >>>>> "Robert" == Robert Dewar <dewar@gnat.com> writes:
>
> Robert> Zack Weinberg wrote:
> >> Adam Monsen <haircut@gmail.com> writes:
> >>
> >>
> >>> String auto-joins can be dangerous. Is there a way to tell the
> >>> compiler to warn/croak when an auto-join occurs?
> >>
> >>
> >> There is not, and without a way for the programmer to make clear
> >> that a given use of string-constant concatenation is intentional,
> >> I am reluctant to add one.
>
> Robert> I would think the reasonable condition for the warning is
> Robert> that no line feed appears between the two strings, which is
> Robert> indeed unusual usage.
>
> It's usual in macros.
>
> paul
Yep. I would have thought that concatenation that *is* across a linefeed
is most likely to be the case when someone's accidentally omitted a comma
from a list of strings.
cheers,
DaveK
--
Can't think of a witty .sigline today....