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

Mike Frysinger vapier at gentoo.org
Sun Oct 23 13:37:53 CEST 2011


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 CONFIG
>> which *permits* people to use DEBUG?
>
> I don't understand what you mean.
>
> __assert_fail() only ever gets used (and thus needs to be compiled in)
> if DEBUG is defined, right?  SO 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/spi/bfin_spi.c, i put "#define DEBUG" at the top of it.
-mike


More information about the U-Boot mailing list