This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Possible bug in egcs-1.1.2-g77
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Re: Possible bug in egcs-1.1.2-g77
- From: toon at moene dot indiv dot nluug dot nl
- Date: 18 Nov 1999
Rafal Podeszwa wrote:
subroutine conversion(number,b1,b2,b3,b4)
integer*4 number,b1,b2,b3,b4,x,y
character*1 u(4),v(4)
equivalence (x,u(1)),(y,v(1))
x=number
v(1)=u(1)
b1=y
v(1)=u(2)
b2=y
v(1)=u(3)
b3=y
v(1)=u(4)
b4=y
return
end
---END----test.f
The program was compiled without any optimization and other compiler
options. I checked the source code with ftncheck and got no errors nor
warnings.
That's one minus point for FTNCHEK then - it doesn't detect that you
didn't initialise 3 out of four bytes of character*1 v(4).
If you do, by adding
y = 0
in front of
x=number
you'll get the correct answer.
Hope this helps,
Toon.