[klibc] [PATCH 1/2] Fix assert when NDEBUG defined

Jon Ringle jon at ringle.org
Thu Jan 7 06:03:49 PST 2010

Don't use the parameter x in assert(x) if NDEBUG is defined to avoid any
problems where (x) may contain symbols that are only defined if !NDEBUG

Signed-off-by: Jon Ringle <jon at ringle.org>
 usr/include/assert.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/usr/include/assert.h b/usr/include/assert.h
index d89e082..e59ed94 100644
--- a/usr/include/assert.h
+++ b/usr/include/assert.h
@@ -9,7 +9,7 @@
 #ifdef NDEBUG
-#define assert(x) ((void)(x))
+#define assert(x) ((void)(0))

More information about the klibc mailing list