Dear Mike Frysinger, In message <201106221723.27679.vap...@gentoo.org> you wrote: > > the trouble with ifdef magic like this is that errors/warnings can be=20 > introduced when DEBUG isnt defined, and then only noticed when DEBUG is=20 > defined. so how about: > > #ifdef DEBUG > # define _DEBUG 1 > #else > # define _DEBUG 2
1 and 2? You don't happen to mean 1 and 0 ? > #define assert(x) \ > do { \ > if ((x) && _DEBUG) \ > printf("%s:%s():%i: assertion failure: %s\n", \ > __FILE__, __func__, __LINE__, #x); \ > } while (0) This way the code will _always_ be compiled in. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de "In the long run, every program becomes rococo, and then rubble." - Alan Perlis _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot