g77 of egcs-1.0.2/1.0.3a returns exit code 1 for argument type mismatch

Mako Sasaki sasaki@tyo.sci.jri.co.jp
Thu Sep 17 23:09:00 GMT 1998


Sorry for too much delay in reply ( one and a half months ... )
about an argument mismatch handling in g77/egcs-1.0.x.

From: N8TM@aol.com
Subject: Re: g77 of egcs-1.0.2/1.0.3a returns exit code 1 for argument type mismatch
Date: Wed, 29 Jul 1998 09:07:51 EDT

> In a message dated 7/29/98 4:04:37 AM Pacific Daylight Time,
> sasaki@tyo.sci.jri.co.jp writes:
> 
> >     subroutine AA( a,b,c,i )
> >        real*8 a,b,c
> >        integer i     
> >  C     
> >  C
> >        return  
> >        end     
> >  C     
> >        subroutine BB( a,b,c,d )
> >        real*8 a,b,c,d 
> >  C    
> >        call AA( a,b,c,d )
> 
> 
> This clearly will not work on some platforms supported by egcs, so I think
> it's reasonable for the compiler to treat it as a fatal error.  The
> traditional way to do this would be to have the receiving function store the
> argument in a real which is equivalenced to an integer.  This is required to
> compile, but still has non-portable implications.  

You are right in writing perfectly portable fortran programs.

But the problem is that the compiler did not say any "fatal error" message,
and, in more realistic case, such a coding style has been used intentinally;

ex.

*-----------------------------------------------
      subroutine AA( a,b,c,i )
      real*8 a,b,c
      integer i
C     
      return  
      end     
C     
      program BB
      real a(100)
C    
      call AA( a(1),a(3),a(5),a(6) )
      end     
*----------------------------------------------

I think such a case should be treated as "warning" level to compile some vintage programs.

 ===================================================================
 Makoto Sasaki  : The Japan Research Institute Ltd.
                  sasaki@tyo.sci.jri.co.jp



More information about the Gcc-bugs mailing list