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]

Re: Possible bug in egcs-1.1.2-g77


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.


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