Behaviour change for double-free'ing a pointer

Ralf Corsepius ralf.corsepius at rtems.org
Thu Dec 20 05:24:29 UTC 2007


On Wed, 2007-12-19 at 14:44 -0600, Joel Sherrill wrote:
> Aaron J. Grier wrote:
> > On Wed, Dec 19, 2007 at 10:11:52AM -0600, Joel Sherrill wrote:
> >   
> >> There is no good answer.  I am sure someone will argue that there
> >> should be no assert's in the normal runtime.  At least people have
> >> vehemently argued that before.  :-D
For the record: I am vehemently opposed to NOT allowing assert.

> > -DNDEBUG doesn't work anymore?  (=
> >   
> This begs a bigger question... should RTEMS assert at all?
Why shouldn't it?

> Most of the asserts I have analyzed over the past couple of months
> cannot occur unless there is a data corruption problem or problem
> with the RTEMS internal logic.
Exactly this is the rationale behind assert/NDEBUG.

Normally, you don't want your code compiled with -DNDEBUG, because you
want to find such issues, as a developer during development as well as
in "production binaries", because want your application to report proper
error message in case something goes wrong.

Of cause there are cases, in which you don't want or can't use "assert".

>   Those are being marked with
> RTEMS_DEBUG conditionals.  Otherwise they are untestable
> dead code.
IMO, this questions RTEMS_DEBUG.

> Should it be possible for RTEMS provided code to halt at run-time?
I don't understand what you mean by this.

Ralf





More information about the users mailing list