home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / vms / 22162 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  2.6 KB

  1. 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
  2. From: rankin@EQL.CALTECH.EDU (Pat Rankin)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: VAXC divide problems (V3.2)
  5. Message-ID: <930127165424.22a00e43@EQL.Caltech.Edu>
  6. Date: 28 Jan 93 01:10:18 GMT
  7. References: <9301271829.AA15261@uu3.psi.com>
  8. Sender: daemon@ucbvax.BERKELEY.EDU
  9. Distribution: world
  10. Organization: The Internet
  11. Lines: 45
  12.  
  13. >>      Gruesome details are available in the CRTL portion of the VMS
  14. >>      listings.  This ugly violation of the VMS Procedure Calling Standard
  15.  
  16. > In what way is this a violation of the Procedure Calling Standard?  It is
  17. > perfectly legitimate for a procedure to reserve space on the stack for data of
  18. > local interest; nothing says that that space has to correspond to variables
  19. > visible to the user.
  20.  
  21.      That won't wash.  The violation is in VAXC$ESTABLISH, which will
  22. clobber the top of your stack if you haven't allocated the undocumented
  23. hidden variable for it.  It mungs its _caller's_ stack; that's completely
  24. different from extra stack space being used by the current procedure.
  25.  
  26.      Alternatively, your own code can clobber the saved handler address,
  27. which in turn can result in an ACCVIO inside VAXCRTL for non-longjmp
  28. conditions.  The documentation for VAXC$ESTABLISH states that it is only
  29. usable from code compiled by VAX C because that particular compiler
  30. allocates stack space for its use, but it still violates the procedure
  31. calling standard.
  32.  
  33. >                      It is perfectly permissible for a condition handler to
  34. > make calls to other procedures, basing its choices on locally available data.
  35. > That's just what this condition handler is doing; it's no different, in
  36. > principle, from having a local variable that indicates what you were trying
  37. > to do, and a condition handler that checks that variable to decide what
  38. > further action to take.
  39.  
  40.      That would be true if such usage didn't interfere with user code.
  41. Try calling VAXC$ESTABLISH from code compiled by some other compiler
  42. sometime (recent releases of GCC excepted), then tell me that it isn't
  43. violating the procedure calling standard.
  44.  
  45. >>      is for setjmp/longjmp handling, and is inherited from the Pascal
  46. >>      compiler of all places! ...
  47.  
  48. > Actually, I think it's the BASIC compiler (which had to pull the same kind
  49. > of trick to implement its user error handling).
  50.  
  51.      My post was not based on speculation; check the source listings.
  52. They took the implementation from Pascal's GOTO handler.  Perhaps the
  53. Pascal implementation was derived from BASIC's, but if so, the C code
  54. doesn't mention it.
  55.  
  56.         Pat Rankin, rankin@eql.caltech.edu
  57.  
  58.