From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,1ef3b84ca62fad7b X-Google-Attributes: gidfee84,public X-Google-Thread: 1094ba,1ef3b84ca62fad7b X-Google-Attributes: gid1094ba,public From: Craig Burley Subject: Re: fortran error? Date: 1998/03/17 Message-ID: #1/1 X-Deja-AN: 334965479 References: <3507A4A5.F8A7DDC2@matd.tu-graz.ac.at> <6ejfii$kbd@usenet.pa.dec.com> <350E95A7.41C6@still3.chem.columbia.edu> Organization: Cygnus Support Newsgroups: comp.lang.fortran,comp.unix.osf.osf1 Peter Shenkin writes: > I would really like to see an addition to the standard which requires > inability to "allocate" an automatic to be treated similarly to > the treatment of inability to ALLOCATE an ALLOCATABLE when no STATUS > variable is supplied: namely, stop the program with a descriptive > error message. I believe the Absoft compilers do this (at least > the LINUX one.) > > Quality of implementation should demand even more than this: if > an automatic cannot be "allocated" on the stack, the run-time system > should allocate it on the heap. Ah, a voice of sanity, clearly unfettered by any in-depth knowledge of popular computer architectures, operating systems, or compiler code-generation techniques. ;-) Yes, like you might, I can certainly expound on many reasons I know of, having expertise in *those* topics, that your suggestions are infeasible or, at least, would be unpopular among Fortran implementors of most any stripe. However, as someone whose seen this issue come up over and over again for, well, decades, in various guises, I can really only say "Hallelujah!" and, then, "...we'll figure out later how to make it work reliably *and* fast". (In short, the problem is this: on most systems, dynamically allocating and later deallocating space on the stack is very fast, *especially* if you don't care about elegantly catching the situation where there isn't enough space on the stack. Mandating that Fortran implementations provide a more-elegant diagnostic for this requires either a somewhat slower mechanism, or more, perhaps much more, cooperation from some combination of the linker, operating system, or CPU and its architecture.) In the meantime, maybe someone can look into fixing Linux so its default behavior for handling SEGV that seems to involve a stack overflow includes printing some message like "stack overflow". (As far as systems that cannot handle invoking user-defined signal handlers when the stack overflow...well, I don't think I'm used to that, guess there's not as much call for that sort of thing as there was long ago. Certainly there's no real technical impediment to it I can think of.) -- "Practice random senselessness and act kind of beautiful." James Craig Burley, Software Craftsperson burley@gnu.org