looking for rs/6k aix 3.1 buglist

John F Haugh II jfh at rpp386.cactus.org
Sun May 26 09:22:50 AEST 1991


In article <1991May25.005319.29296 at cunixf.cc.columbia.edu> dmj at 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 at rpp386.cactus.org
"If liberals interpreted the 2nd Amendment the same way they interpret the
 rest of the Constitution, gun ownership would be mandatory."



More information about the Comp.unix.aix mailing list