This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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]

Re: Remove noreturn attribute for __assert_func on embedded build


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


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