M
Michael B Allen
Is there anything wrong with this macro?
#define randint(a,b) (a)+(((b)-(a)+1)*(float)rand()/RAND_MAX)
If I do randint(10, 0x10000) in a loop it sporatically generates:
Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
with no backtrace and I compiled with debugging symbols. Could this be
a bug in gcc?
$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-110)
#define randint(a,b) (a)+(((b)-(a)+1)*(float)rand()/RAND_MAX)
If I do randint(10, 0x10000) in a loop it sporatically generates:
Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
with no backtrace and I compiled with debugging symbols. Could this be
a bug in gcc?
$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-110)