[ECOS] How to display assertions by diag_printf ?

Riadh Elloumi riadh.elloumi@parrot.fr
Mon Mar 13 18:30:00 GMT 2006


Hi all,

Looking at the assert.h, I see that there are many ways to display the 
assertion fails in eCos, the compiled one for me is:

#if defined(CYGINT_ISO_STDIO_FORMATTED_IO) && defined(CYGINT_ISO_EXIT)

# include <stdio.h>
# include <stdlib.h>

# define assert( __bool )                                                 \
     do {                                                                  \
         if (0 == (__bool)) {                                              \
             fprintf( stderr, "User assertion failed: \"%s\", at %s:%d\n", \
                          #__bool, __FILE__, __LINE__);                    \
             abort();                                                      \
         }                                                                 \
     } while(0)


Both CYGINT_ISO_STDIO_FORMATTED_IO and CYGINT_ISO_EXIT are defined. 
Compliancy is a good thing, but the fprintf fails as well with an 
assertion fail, and I have a result like this:

UseASSERT FAIL: <4>_exit.cxx[83]void _exit() Program _exiting with
non-zero error status

How can I disable this assertion mode to see clearly what assert has 
failed? The latter mode is ok for me (with diag_printf).

Thank you for your help

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list