Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c Subject: Re: Is this correct a=/* comment */b; Keywords: comment, operator Message-ID: <584@taumet.com> Date: 5 Feb 91 16:56:39 GMT References: <532@ctycal.UUCP> Organization: Taumetric Corporation, San Diego Lines: 25 pat@ctycal.UUCP (Patrick Woo) writes: >a=/* This is a comment */b; >Just wondering whether the compiler should read the line as >a = /*comment*/ b; >or >a =/ *comment ...; Under Standard (ANSI/ISO) C, =/ is not a token, so the only valid reading is a = /*comment*/ b; In K&R1 (1978), =/ and friends are listed as already obsolete -- 13 years ago! Some compilers continued to accept =/ as a token, but marked them with a warning. If a compiler (in violation of the Standard) now chooses to accept =/ as a valid token, then the rule about "longest string which could be a token" applies, and the compiler must interpret the example as a =/ *comment */ b; which contains at least a syntax error. I don't see why any compiler should accept =/ and friends any more. -- Steve Clamage, TauMetric Corp, steve@taumet.com