This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Newbie: C++ Frontend Lexical Analysis Issue, <::abs(n) does notparse




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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]