small libf2c cleanups

Dave Love d.love@dl.ac.uk
Sun Oct 19 05:42:00 GMT 1997


>>>>> "Craig" == Craig Burley <burley@gnu.org> writes:

 Craig> However, I can't figure out what SIGNAL is supposed to do in
 Craig> the Fortran libU77 world (which I know little about, aside
 Craig> from what I've learned by doing g77).  Presumably it is just a
 Craig> wrapper for signal(2), in which case it looks like SIGNAL
 Craig> should return a pointer as well.

The situation is a mess.  The f2c definition of signal disagrees with
the one in Sun Fortran, which we've teneded to regard as canonical.  I
don't know what the original BSD definition was but can probably find
out at work.  The Sun definition explcitly defines a function form
which returns an integer.  I doubt many people make use of it to
switch back and forth between handlers anyhow, and don't think it's
worth worrying about greatly.  The appropriate standard technique is
presumably posix.9 (on which someone was supposed to be working but
which we don't have).  I have in mind to implement as much of the
fortran2000 exception-handling proposal as sensible when it becomes
clear how configuring and building the compiler works eventually.

 Craig> It looks like the documentation for SIGNAL is botched a bit,
 Craig> at least, in that it confuses the NUMBER and HANDLER arguments
 Craig> in the sentence "If NUMBER is an integer...".  Can anyone
 Craig> confirm this?

Yes, I'll try to reconstruct it.

 Craig> Anyway, to teach g77 that an intrinsic returns a pointer as a
 Craig> function value, change gcc/f/com-rt.def so its entry starts
 Craig> with "Ip:", a la LOC.

... but this change would be incompatible.

 Craig> I can't do much about this just yet, but maybe early this
 Craig> coming week I'll be able to send patches for some of these
 Craig> things.

I was going to look at it, but the relevant disc seems to have gone
away.  Let me know whether or not I should do it later.

BTW, Fortran users definitley shouldn't be given the impression that
they can generally pass around C-like pointers without losing.



More information about the Gcc mailing list