home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 19871 < prev    next >
Encoding:
Text File  |  1993-01-25  |  1.8 KB  |  45 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!cs.utexas.edu!sdd.hp.com!swrinde!emory!sol.ctr.columbia.edu!ira.uka.de!slsvaat!josef!kanze
  3. From: kanze@us-es.sel.de (James Kanze)
  4. Subject: Re: setjmp/longjmp question
  5. In-Reply-To: erics@cadkey.cadkey.com's message of Fri, 8 Jan 1993 19:56:13 GMT
  6. Message-ID: <KANZE.93Jan25184636@slsvdnt.us-es.sel.de>
  7. Sender: news@us-es.sel.de
  8. Organization: SEL
  9. References: <1993Jan8.195613.14303@cadkey.com>
  10. Date: 25 Jan 93 18:46:36
  11. Lines: 32
  12.  
  13. In article <1993Jan8.195613.14303@cadkey.com> erics@cadkey.cadkey.com
  14. (Eric Smith) writes:
  15.  
  16. |> In <setjmp.h>, Microsoft C has a #ifndef to comment out the entire
  17. |> contents of the file if compiling a C++ program.  Other compilers I
  18. |> use (Borland, ObjectCenter, and one other cfront implementation) allow
  19. |> setjmp/longjmp even from a C++ program.
  20.  
  21. |> I realize the problems with stack unwinding and object destruction,
  22. |> but why doesn't Microsoft let me use these?  It is kind of a problem
  23. |> when I am porting a straight C program to C++ just to get some
  24. |> additional type checking.
  25.  
  26. |> I could find no mention of this in the ARM.
  27.  
  28. |> Does anyone know of any other C++ compiler that doesn't allow setjmp?
  29.  
  30. No.
  31.  
  32. The C++ standards committee have said that they are adopting the C
  33. library more or less integrally, so I would suppose that this means
  34. setjmp/longjmp too.
  35.  
  36. Further, I have actually used setjmp/longjmp in full C++ programs
  37. (with polymorphic classes, etc.).  Obviously, its uses are limited,
  38. and you'd better know what you're doing, but it can be done, and in
  39. the absence of exceptions...
  40. --
  41. James Kanze                             email: kanze@us-es.sel.de
  42. GABI Software, Sarl., 8 rue du Faisan, F-67000 Strasbourg, France
  43. Conseils en informatique industrielle --
  44.                    -- Beratung in industrieller Datenverarbeitung
  45.