GCC bug report
Yeh Hong-ming
hongming@cs.utexas.edu
Mon Nov 17 00:27:00 GMT 2003
Thank you for pointing this out. The code actually came from a widely used
neural network simulator, Lens. I will let its auther know.
GCC Manual says that bug reports should be sent to gcc-bugs@gnu.org.
Perhaps the person in charge can consider revising the Bug Report section of
the Manual?
Thanks
Yeh Hong-ming
-----Original Message-----
From: Jim Wilson [mailto:wilson@specifixinc.com]
Sent: Sunday, November 16, 2003 6:10 PM
To: Yeh Hong-ming
Cc: gcc-bugs@gcc.gnu.org
Subject: Re: GCC bug report
Yeh Hong-ming wrote:
> *v = *(char*)&q;
Your program is broken. This copies one (1) byte into *v. This is
easier to see if you put a line "x = 0;" before the call to the function
g. Then you will see that the result of the function g is 0x3f and not
the expected 0x6666663f.
This program also has unsafe pointer casts. ISO C says that accessing
an object with a different type (other than char) is undefined. So
"*(float *)&x" has undefined result, and may fail to work as expected.
We prefer bugs put into bugzilla rather than emailed. See
http://gcc.gnu.org/bugs.html
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
More information about the Gcc-bugs
mailing list