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

2011-10-23 Thread Wolfgang Denk
Dear Mike Frysinger, In message you wrote: > > > __assert_fail() only ever gets used (and thus needs to be compiled in) > > if DEBUG is defined, right? =A0SO why cannot you wrap the code in a > > "#ifdef DEBUG" ? > > people often enable DEBUG on a per file basis. so if i'm debugging > drivers/

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

2011-10-23 Thread Wolfgang Denk
Dear Mike Frysinger, In message you wrote: > > >> +void __assert_fail(const char *assertion, const char *file, unsigned line, > >> +const char *function) > >> +{ > >> + /* This will not return */ > >> + panic("%s:%u: %s: Assertion `%s' failed.", file, line, function, > >>

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

2011-10-23 Thread Mike Frysinger
On Sun, Oct 23, 2011 at 04:35, Wolfgang Denk wrote: > Simon Glass wrote: >> > Can you please #ifdef it so it doesn't get added for the non-debug >> > case, too? >> >> Well I could, but then if someone defines DEBUG in a file they will >> get a link error I think. Or are you thinking of adding a new

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

2011-10-23 Thread Wolfgang Denk
Dear Simon Glass, In message you wrote: > > > Can you please #ifdef it so it doesn't get added for the non-debug > > case, too? > > Well I could, but then if someone defines DEBUG in a file they will > get a link error I think. Or are you thinking of adding a new CONFIG > which *permits* people

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

2011-10-22 Thread Mike Frysinger
On Fri, Oct 21, 2011 at 18:20, Wolfgang Denk wrote: > Simon Glass wrote: >> +void __assert_fail(const char *assertion, const char *file, unsigned line, >> +                const char *function) >> +{ >> +     /* This will not return */ >> +     panic("%s:%u: %s: Assertion `%s' failed.", file, line,

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

2011-10-21 Thread Simon Glass
Hi Wolfgang, On Fri, Oct 21, 2011 at 3:20 PM, Wolfgang Denk wrote: > Dear Simon Glass, > > In message <1315434680-21641-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

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

2011-10-21 Thread Wolfgang Denk
Dear Simon Glass, In message <1315434680-21641-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.