comp.lang.ada
 help / color / mirror / Atom feed
From: Ian Johnston <ian.johnston@ubs.com>
Subject: Re: Ada and C++ asserts.
Date: 1996/07/18
Date: 1996-07-18T00:00:00+00:00	[thread overview]
Message-ID: <31EE4C88.1AAD@ubs.com> (raw)
In-Reply-To: nh91cle14t.fsf@paralysys


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?




  parent reply	other threads:[~1996-07-18  0:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-15  0:00 Ada and C++ asserts Nasser Abbasi
1996-07-15  0:00 ` Giuliano Carlini
1996-07-15  0:00 ` Nasser Abbasi
1996-07-16  0:00   ` Robert Dewar
1996-07-18  0:00   ` Ian Johnston [this message]
1996-07-22  0:00   ` Richard Curnow
1996-07-15  0:00 ` Robert Dewar
1996-07-15  0:00 ` Fergus Henderson
1996-07-15  0:00 ` Stephen Leake
1996-07-16  0:00 ` Ian Johnston
1996-07-16  0:00 ` Eric Kline
1996-07-16  0:00   ` Jon S Anthony
1996-07-17  0:00 ` James McCallum
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox