Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c Subject: Re: Casting pointers Message-ID: <328@taumet.com> Date: 20 Jul 90 15:50:59 GMT References: <1614@ghost.stsci.edu> <9959@crdgw1.crd.ge.com> <23590@shamash.cdc.com> Organization: Taumetric Corporation, San Diego Lines: 19 harkcom@potato.pa.Yokogawa.CO.JP (Alton Harkcom) writes: >In article <23590@shamash.cdc.com> > bls@svl.cdc.com (brian scearce) writes: > =}It shouldn't compile at all. The mighty CDC C Version 2 prints, > =}"Operation can only be performed on lvalues", an excellent diagnostic > ^^^^^^^ > Shouldn't that be rvalue? No. If the statement is something like: (char*)p += i; the complaint is not about the cast, but about the left side of the += operator, which must be an lvalue. A cast does not result in an lvalue. Actually the left side must be a *modifiable* lvalue, and the error message would be better if it said that. -- Steve Clamage, TauMetric Corp, steve@taumet.com