From: Mr.Cashe <mr...@ma...> - 2007-01-06 02:10:09
|
2 Erik Petrich <epetrich@iv...> - 2007-01-03 22:33 Yes, you the rights. I know about arithmetic on void pointers, but I expected type-conversion operator will make it possible to deceive the compiler. For example, Borland C++ 5.02 and Keil uVision-2 process the following code successfully and do what I need: void func(void *dest, void *src, int size) { while (size--) *((char*)dest)++ = *((char*)src)++; } But this is erroneous, because standard speaks: "A cast does not yield lvalue". This is why nor increment, nor assignments does not work in this case. These compilers have strange idea about the precedence of the operators. Therefore, gcc and sdcc more correct. Thank you all. |