Remove noreturn attribute for __assert_func on embedded build
Freddie Chopin
freddie_chopin@op.pl
Fri Feb 7 15:29:00 GMT 2014
W dniu 2014-02-07 09:46, PaweÅ pisze:
> Do not take me wrong, I am not insist about this, but this was my
> observation when I had to refactor whole my code to provide custom,
> nonstandard assert() macro to show when my code is failing becouse stack
> trace was broken.
1. There's nothing stopping you from having your own assert.h header
without the attribute
2. If your assert() is not standard, than it is not an assert() - you
should name it differently (debug_assert()? conditional_assert()?) and
use it for the purpose you described
I'm also an embedded developer, but I don't have anything against
noreturn attribute of assert() - if the assert fails (for example
because of nullptr dereferencing) then what's the point of returning?
assert() is not a substitution for a breakpoint of a debug output...
Regards,
FCh
More information about the Newlib
mailing list