gcc4 and casting lvalues
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com It appears that gcc 4 has an issue with casting lvalues: % cat > test.c #include <stdio.h> int main() { void* vp = 0; #ifdef A (long*)vp += 1; #endif #ifdef B vp = (long*)vp + 1; #endif printf("vp: %p\n", vp); return 0; } % gcc-4.0 -DA test.c && ./a.out test.c: In function 'main': test.c:8: error: invalid lvalue in assignment % gcc-4.0 -DB test.c && ./a.out vp: 0x4 % gcc-3.3 -DA test.c && ./a.out vp: 0x4 % gcc-3.3 -DB test.c && ./a.out vp: 0x4 Is this expected behaviour? I might have a lot of code to change... Sam _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Sam Vaughan