This is the mail archive of the gcc@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: g77 compiles illegal code in testsuite?


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


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