Re: [U-Boot] [PATCH v2] Add assert() for debug assertions

2011-06-24 Thread Mike Frysinger
On Fri, Jun 24, 2011 at 14:13, Simon Glass wrote: > On Thu, Jun 23, 2011 at 10:33 PM, Wolfgang Denk wrote: >> Finally, should the assert() not result in some termination or hang of >> U-Boot, like assert(3) is doing? > > I'm happy either way so long as it prints a message. A hang is better > than a

Re: [U-Boot] [PATCH v2] Add assert() for debug assertions

2011-06-24 Thread Simon Glass
Hi Wolfgang, On Thu, Jun 23, 2011 at 10:33 PM, Wolfgang Denk wrote: > Dear Simon Glass, ... >> +#define assert(x)    \ >> +     ({ if (!(x) && _DEBUG) \ >> +             printf("Assertion failure '%s' %s line %d\n", \ >> +                     #x, __FILE__, __LINE__); }) > > Can we please use the

Re: [U-Boot] [PATCH v2] Add assert() for debug assertions

2011-06-23 Thread Wolfgang Denk
Dear Simon Glass, In message <1308870873-32540-1-git-send-email-...@chromium.org> you wrote: > assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined. > This is useful when a condition is an error but a board reset is unlikely > to fix it, so it is better to soldier on in hope.

Re: [U-Boot] [PATCH v2] Add assert() for debug assertions

2011-06-23 Thread Mike Frysinger
Acked-by: Mike Frysinger -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

[U-Boot] [PATCH v2] Add assert() for debug assertions

2011-06-23 Thread Simon Glass
assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined. This is useful when a condition is an error but a board reset is unlikely to fix it, so it is better to soldier on in hope. Assertion failures should be caught during development/test. It turns out that assert() is defined