This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: GCC bug report


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]