Skip navigation.
 
mlRe: GCC not doing the correct thing?
FROM : Clark S. Cox III
DATE : Mon Nov 11 15:46:31 2002

-----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_removed>
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_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlGCC not doing the correct thing? Andrew Yager Nov 7, 21:53
mlRe: GCC not doing the correct thing? Matthew Fahrenbach… Nov 7, 22:29
mlRe: GCC not doing the correct thing? Cameron Hayne Nov 7, 22:41
mlRe: GCC not doing the correct thing? Stéphane Sudre Nov 8, 02:35
mlRe: GCC not doing the correct thing? Richard Cleis Nov 8, 10:46
mlRe: GCC not doing the correct thing? Clark S. Cox III Nov 8, 10:53
mlRe: GCC not doing the correct thing? Richard Cleis Nov 8, 12:40
mlRe: GCC not doing the correct thing? Domain Administrat… Nov 8, 12:54
mlRe: GCC not doing the correct thing? Clark S. Cox III Nov 8, 13:08
mlRe: GCC not doing the correct thing? Nat! Nov 8, 20:23
mlRe: GCC not doing the correct thing? Andrew Yager Nov 8, 20:29
mlRe: GCC not doing the correct thing? Domain Administrat… Nov 9, 22:35
mlRe: GCC not doing the correct thing? Clark S. Cox III Nov 11, 07:13
mlRe: GCC not doing the correct thing? Thomas Castiglione Nov 11, 13:21
mlRe: GCC not doing the correct thing? Clark S. Cox III Nov 11, 15:21
mlRe: GCC not doing the correct thing? Keith Ray Nov 11, 15:43
mlRe: GCC not doing the correct thing? Clark S. Cox III Nov 11, 15:46
mlRe: GCC not doing the correct thing? Clark S. Cox III Nov 11, 16:12
mlRe: GCC not doing the correct thing? Cameron Hayne Nov 11, 23:31
mlRe: GCC not doing the correct thing? Thomas Castiglione Nov 12, 11:48