This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Newbie: C++ Frontend Lexical Analysis Issue, <::abs(n) does notparse
- From: Thierry Moreau <thierry dot moreau at connotech dot com>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 29 Mar 2004 11:16:14 -0500
- Subject: Re: Newbie: C++ Frontend Lexical Analysis Issue, <::abs(n) does notparse
- References: <40659FBD.4050106@connotech.com> <87smftuanf.fsf@codesourcery.com>
Zack Weinberg wrote:
Thierry Moreau <thierry.moreau@connotech.com> writes:
The following sample fails to compile by GCC, and I am surprised:
...
{ return ::abs(m)<::abs(n); } /* parse error here (!) */
When the two characters <: appear next to each other like this, it is
taken as an alternate spelling ("digraph") for a [ token. The point
of this is to make it easier to write C on the (rare) platforms which
do not have an [ character. This is an awkward feature but the
language standard requires it.
Inserting a space is the correct fix.
Agreed, thanks for your explanation.
Please excuse my reluctance to file an official bug report in
another problem reporting service.
Huh? Is there a problem with our bug tracking system?
No, I just was not shure if it was a bug in the first place, and I
wanted someone more knowledgeable to file an official bug report if need be.
I certainly didn't intend to fill a *bug* report while I was to learn
that the digraph feature is part of the C language definition since the
first amendment to ANSI C:1989 (I somehow antcipated some valid explanation)
Regards,
--
- Thierry Moreau
CONNOTECH Experts-conseils inc.
9130 Place de Montgolfier
Montreal, Qc
H2M 2A1
Tel.: (514)385-5691
Fax: (514)385-5900
web site: http://www.connotech.com
e-mail: thierry.moreau@connotech.com