Porting software to Linux

toon@moene.indiv.nluug.nl toon@moene.indiv.nluug.nl
Fri Dec 31 20:54:00 GMT 1999


Marilyn Celestin wrote:

      program try
        implicit none
        integer*2 k,h
        k = -1
        h = k
        if (h .eq. x'ffff') write (6,*) 'h equals'  !ffff treated as i*4
        if (k .eq. 'ffff'x) write (6,*) 'k equals'  !ffff treated as i*2
        end          

The code was compiled with f77 -fugly-logint -o try try.f

The result was:
K equals

Is this a compiler error? Shouldn't the -fugly-logint option give the same
result in both cases?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

No - for this particular case you also need: -ftypeless-boz

See the explanation at:  http://gcc.gnu.org/onlinedocs/g77_toc.html#TOC16

Hope this helps,
Toon Moene.



More information about the Gcc-bugs mailing list