Hi,

I'm wondering if there is an "approved" usage of assert vs debugassert for files/apps in the nuttx-apps repo?

My thinking is:

 * use debugassert if a function in apps would only fail if the calling
   code, probably (or possibly only) if other functions within apps,
   rather than an unknown higher level app,  have done something dumb
   that should be picked up during nuttx-apps development and so should
   not make it through to final code; but if they do, that's the fault
   of the developer for not turning on debug asserts!!
 * use assert if the error would cause the obviously unknown
   higher-level calling app someone's writing to fail if the error was
   allowed to pass unchecked, so the developer of that higher level app
   can deal with it programmatically.

That might almost suggest that debugassert() is for private functions and assert() is for public ones?

Probably over-thinking it as usual, but I'm never afraid to ask :)

Thanks!

TimJTi.

Reply via email to