cast to pointer from integer of different size

Steve Kargl sgk@troutmask.apl.washington.edu
Sun Sep 10 18:51:00 GMT 2006


On Sun, Sep 10, 2006 at 08:40:13PM +0200, Thomas Koenig wrote:
> On Sun, Sep 10, 2006 at 01:45:47PM -0400, Jack Howarth wrote:
> 
> >     *status = (int) signal (*number, handler);
> > 
> >     *status = (int) signal (*number, (void (*)(int)) *handler);
> 
> This is bogus.  signal() returns a pointer to the previous signal
> handler.  g77 uses an integer variable wide enough to hold the
> STATUS argument; we should do the same.
> 
> Can you open a PR?
> 

It's not bogus.  signal returns a sig_t, which is an opaque type.
g77 expects it to return a integer.  sig_t and gfortran's integer
don't need to be the same size.

-- 
Steve



More information about the Fortran mailing list