Newbie: C++ Frontend Lexical Analysis Issue, <::abs(n) does not parse

Thierry Moreau thierry.moreau@connotech.com
Mon Mar 29 15:58:00 GMT 2004



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




More information about the Gcc-bugs mailing list