Re: GCC not doing the correct thing?
Re: GCC not doing the correct thing?
- Subject: Re: GCC not doing the correct thing?
- From: "Clark S. Cox III" <email@hidden>
- Date: Mon, 11 Nov 2002 09:46:31 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Monday, Nov 11, 2002, at 07:21 US/Eastern, Thomas Castiglione wrote:
I couldn't agree more. The GOOD news is that that code works perfectly
in GCC, for me at least. Simple test case, using your example:
#define CUBE(A) ((A) * (A) * (A))
main() {
char *a = "ABCD";
printf("%s\n", a);
cube(*a++);
printf("%s\n", a);
}
I promise you, you are asking for trouble. There is no guarantee that
this behavior will not change (i.e. in a new compiler version, on a new
processor, etc.), because this behavior is undefined according to the C
standard (i.e. the compiler is free to do ANYTHING). You are making
unwarranted assumptions about the language; yes, they are logical
assumptions, and it "feels" right that this should work, but it doesn't.
- --
http://homepage.mac.com/clarkcox3/
email@hidden
Clark S. Cox, III
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (Darwin)
iEYEARECAAYFAj3PwswACgkQd6STocYT1xU9+QCdGsPqqWgnU6PLfrewtRG9Rfyr
zacAmgJkF1uVWA7K4JeTPUkYHpxKH7ru
=YR9C
-----END PGP SIGNATURE-----
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.