This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

How to display assertions by diag_printf ?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]