Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!natinst!sequoia!rpp386!jfh From: jfh@rpp386.cactus.org (John F Haugh II) Newsgroups: comp.unix.aix Subject: Re: looking for rs/6k aix 3.1 buglist Message-ID: <19335@rpp386.cactus.org> Date: 25 May 91 23:22:50 GMT References: <1991May24.203515.16684@usenet.ins.cwru.edu> <1991May25.005319.29296@cunixf.cc.columbia.edu> Reply-To: jfh@rpp386.cactus.org (John F Haugh II) Organization: Lone Star Cat Emporium and BBQ Grill Lines: 34 X-Clever-Slogan: Help Prevent Robbery. Tax the IRS. In article <1991May25.005319.29296@cunixf.cc.columbia.edu> dmj@cunixa.cc.columbia.edu (Douglas M Jaffe) writes: > cc -O cast.c -o cast > 8 | ((int *)c) = &(buf[0]); > .........a...................... >a - 1506-025: (S) Operand must be a modifiable lvalue. >1254-004 The error code from the last failed command is 1. The expression ((int *) c) is not a modifiable l-value. It is the value of the variable "c" treated as a pointer to an integer. If you want to modified what "c" points to, insert a "*" before it. That is, *((int *) c) = &(buf[0]); The result of a cast is not an l-value. If you want "c" to contain the value of the address of the 0-th element, you must do something completely different, like the c = (char *) buf; example that you gave, or possibly *((int *) &c) = &buf[0]; which will do something similiar (only different ;-) -- John F. Haugh II | Distribution to | UUCP: ...!cs.utexas.edu!rpp386!jfh Ma Bell: (512) 255-8251 | GEnie PROHIBITED :-) | Domain: jfh@rpp386.cactus.org "If liberals interpreted the 2nd Amendment the same way they interpret the rest of the Constitution, gun ownership would be mandatory."