cast to pointer from integer of different size

Thomas Koenig Thomas.Koenig@online.de
Sun Sep 10 19:30:00 GMT 2006


On Sun, Sep 10, 2006 at 11:57:44AM -0700, Steve Kargl wrote:

> Why?  The code is casting to an int.  int and INTEGER are
> corresponding types.  This is what g77's signal is documented
> to return.

>From the g77 info file:

#      CALL Signal(NUMBER, HANDLER, STATUS)
# 
# NUMBER: `INTEGER'; scalar; INTENT(IN).
# 
# HANDLER: Signal handler (`INTEGER FUNCTION' or `SUBROUTINE') or
# dummy/global `INTEGER(KIND=1)' scalar.
# 
# STATUS: `INTEGER(KIND=7)'; OPTIONAL; scalar; INTENT(OUT).

and

# `KIND=7'
#      This is valid only as `INTEGER(KIND=7)' and denotes the `INTEGER'
#      type that has the smallest storage size that holds a pointer on
#      the system.

So, g77's STATUS argument is wide enough to hold a pointer.
gfortran's isn't in all cases.  This is a bug.

	Thomas



More information about the Fortran mailing list