Apple gcc bug
Apple gcc bug
- Subject: Apple gcc bug
- From: Aaron Jackson <email@hidden>
- Date: Thu, 17 Mar 2005 16:36:39 -0500
I am trying to do some numerical calculations and ran into an
interesting bug:
[Aaron-Jacksons-Computer:~] jackson% gcc -v
Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
Thread model: posix
gcc version 3.3 20030304 (Apple Computer, Inc. build 1671)
[Aaron-Jacksons-Computer:~] jackson% cat test4.c
#include <stdio.h>
int
main(int argc, char **argv) {
int k;
k=1/0;
printf("k = %d\n",k);
k=0/0;
printf("k = %d\n",k);
exit(0);
}
[Aaron-Jacksons-Computer:~] jackson% gcc -o test4 test4.c
test4.c: In function `main':
test4.c:7: warning: division by zero
test4.c:9: warning: division by zero
[Aaron-Jacksons-Computer:~] jackson% ./test4
k = 0
k = 0
I have tried this on two other macs with the same result. Of course,
this program properly bombs out on the openbsd and solaris systems that
I tried to run it on. I did some google searching and looked through
the list archive, but didn't see this mentioned. Is this a known bug?
If so, are there any workarounds for this, or which versions of gcc are
not effected? Thanks.
Aaron
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden