sizeof intrinsic

Satish Balay balay@fastmail.fm
Sun May 6 15:36:00 GMT 2007


Sorry - should have included the gfortran info as well.

asterix:/home/balay/junk/test>gfortran foo.F 
 In file foo.F:10

       call foo(sizeof(a))                                              
               1
Error: Function 'sizeof' at (1) has no IMPLICIT type
asterix:/home/balay/junk/test>gfortran --version
GNU Fortran 95 (GCC) 4.1.1 20070105 (Red Hat 4.1.1-51)

Satish

On Sun, 6 May 2007, Satish Balay wrote:

> 
> Not sure if sizeof() is part of f95 standard.. However a bunch of
> compilers except gfortran appear to support it.
> 
> Will this be supported by gfortran?
> 
> Thanks,
> Satish
> 
> -----------------
> asterix:/home/balay/junk/test>cat foo.F 
>         subroutine foo(a)
>         implicit none
>         integer a
>         write(*,*) a
>         end
> 
>         program main
>         implicit none
>         integer a
>         call foo(sizeof(a))
>         end
> asterix:/home/balay/junk/test>g95 foo.F 
> asterix:/home/balay/junk/test>./a.out 
>  4
> asterix:/home/balay/junk/test>ifort foo.F 
> asterix:/home/balay/junk/test>./a.out 
>            4
> asterix:/home/balay/junk/test>sun-f90 foo.F 
> asterix:/home/balay/junk/test>./a.out 
>  4
> asterix:/home/balay/junk/test>
> 
> 



More information about the Fortran mailing list