home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!europa.eng.gtefsd.com!paladin.american.edu!howland.reston.ans.net!spool.mu.edu!uwm.edu!linac!att!ucbvax!EQL.CALTECH.EDU!rankin
- From: rankin@EQL.CALTECH.EDU (Pat Rankin)
- Newsgroups: comp.os.vms
- Subject: Re: VAXC divide problems (V3.2)
- Message-ID: <930127165424.22a00e43@EQL.Caltech.Edu>
- Date: 28 Jan 93 01:10:18 GMT
- References: <9301271829.AA15261@uu3.psi.com>
- Sender: daemon@ucbvax.BERKELEY.EDU
- Distribution: world
- Organization: The Internet
- Lines: 45
-
- >> Gruesome details are available in the CRTL portion of the VMS
- >> listings. This ugly violation of the VMS Procedure Calling Standard
-
- > In what way is this a violation of the Procedure Calling Standard? It is
- > perfectly legitimate for a procedure to reserve space on the stack for data of
- > local interest; nothing says that that space has to correspond to variables
- > visible to the user.
-
- That won't wash. The violation is in VAXC$ESTABLISH, which will
- clobber the top of your stack if you haven't allocated the undocumented
- hidden variable for it. It mungs its _caller's_ stack; that's completely
- different from extra stack space being used by the current procedure.
-
- Alternatively, your own code can clobber the saved handler address,
- which in turn can result in an ACCVIO inside VAXCRTL for non-longjmp
- conditions. The documentation for VAXC$ESTABLISH states that it is only
- usable from code compiled by VAX C because that particular compiler
- allocates stack space for its use, but it still violates the procedure
- calling standard.
-
- > It is perfectly permissible for a condition handler to
- > make calls to other procedures, basing its choices on locally available data.
- > That's just what this condition handler is doing; it's no different, in
- > principle, from having a local variable that indicates what you were trying
- > to do, and a condition handler that checks that variable to decide what
- > further action to take.
-
- That would be true if such usage didn't interfere with user code.
- Try calling VAXC$ESTABLISH from code compiled by some other compiler
- sometime (recent releases of GCC excepted), then tell me that it isn't
- violating the procedure calling standard.
-
- >> is for setjmp/longjmp handling, and is inherited from the Pascal
- >> compiler of all places! ...
-
- > Actually, I think it's the BASIC compiler (which had to pull the same kind
- > of trick to implement its user error handling).
-
- My post was not based on speculation; check the source listings.
- They took the implementation from Pascal's GOTO handler. Perhaps the
- Pascal implementation was derived from BASIC's, but if so, the C code
- doesn't mention it.
-
- Pat Rankin, rankin@eql.caltech.edu
-
-