From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a0e076952eca80d4 X-Google-Attributes: gid103376,public From: Ian Johnston Subject: Re: Ada and C++ asserts. Date: 1996/07/18 Message-ID: <31EE4C88.1AAD@ubs.com>#1/1 X-Deja-AN: 169489153 references: content-type: text/plain; charset=us-ascii organization: UBS mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.01 (WinNT; I) Date: 1996-07-18T00:00:00+00:00 List-Id: Nasser Abbasi wrote: > > From: nasser@apldbio.com (Nasser Abbasi) > > ref (me): calling assert from C++ generates core dump, but > not from Ada. > > Someone just pointed out to me that C/C++ assert can generate > a core dump, and this is an expected behaviour. > > So, It seems there is nothing wrong with the C++ program, > it core dumps becuase this is what it is supposed to do. > > I think this is not natural behaviour, but since it is > documented like this, one can't argue with it. Given that C has no concept of exceptions, on many platforms a core dump is a very reasonable thing to do. C++ has simply 'inherited' assert() from C. On any UNIX, you can look at the core dump with a debugger and get a stack trace showing not only where the core dump happened, but the chain of function calls leading up to it, along with parameter and variable values. Even on VMS, you get a stack trace showing how you arrived at the assert. What information does Ada supply about the circumstances leading to the failed assertion?