g77 compiles illegal code in testsuite?

Paul Brook paul@nowt.org
Fri May 23 14:23:00 GMT 2003


On Friday 23 May 2003 1:34 pm, Bud Davis wrote:
> Just to confuse things more, i compiled this snippet
>
>         INTEGER I
>         REAL R,NUM
>         NUM=MAX(I,R)
>         END
>
> on a few f77 compilers:
>
> sgi - MIPSPro-77 --   Compiles without warnings or errors
> dec - f90 /f77   --   Fatal Error on type mismatch
>
>
> Maybe g77 should issue a warning (when invoked with -fpedantic) ?
>
> Of course, IMHO, g95 should be backwards compatable with g77 :)

G95 currently allows different type kinds (ie. double or single precision) as 
an extension, but not different types. It could easily be modified to accept 
different types. I've no idea how easy/hard it would be to get g77 to do 
something similar.

As this code is non-portable and techincally illegal a warning is issued. This 
becomes an error with -pedantic.

Paul



More information about the Gcc mailing list