Article View: comp.std.c
Article #4688Double-character operators
From: Richard F. Smiley
Date: Mon, 22 Jan 1996 23:51
Date: Mon, 22 Jan 1996 23:51
19 lines
1112 bytes
1112 bytes
Is the program fragment
if ( Boolean_A & = 0x0020 )
legal? Specifically, should the three-character sequence "& =" be
treated as representing the two-character operator "&="?
As I understand the standard (ISO section 5.1.1.2, phase 7), the "&"
is converted into one token, and the "=" is converted into another.
This then precludes treating them as one operator, and the program
fragment is illegal.
However, a compiler I respect instead treats this as a legal fragment
involving the "&=" operator. Is that allowed? (The program fragment
was caused by a bad macro definition. If the compiler had complained,
we would have found the problem earlier.)
--
Richard Smiley (317) 451-0866 c2xrfs@eng.delcoelect.com
Technical Details
Message-ID:
<4e17uk$g3@kocrsv08.delcoelect.com>Path:
arc1-ca.pugleaf.net!news.delcoelect.com!c2xrfsShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.delcoelect.com!c2xrfs From: c2xrfs@eng.delcoelect.com (Richard F. Smiley) Newsgroups: comp.std.c Subject: Double-character operators Date: 22 Jan 1996 23:51:48 GMT Organization: Delco Electronics Distribution: world Message-ID: <4e17uk$g3@kocrsv08.delcoelect.com> NNTP-Posting-Host: koptsw53.delcoelect.com Originator: c2xrfs@koptsw53