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)) #else -- 1.6.5.rc2
several autoconf tests use ferror()
Stream errors are not being tracked by klibc implementation,
so provide a dummy ferror() that just returns 0.
Signed-off-by: Jon Ringle <jon at ringle.org>
---
usr/include/stdio.h | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/usr/include/stdio.h b/usr/include/stdio.h
index 1993f75..7d2c86d 100644
--- a/usr/include/stdio.h
+++ b/usr/include/stdio.h
@@ -115,6 +115,13 @@ static __inline__ int fflush(FILE * __f)
return 0;
}
+/* stream errors are not kept track of by klibc implementation */
+static __inline__ int ferror(FILE * __f)
+{
+ (void)__f;
+ return 0;
+}
+
__extern int sscanf(const char *, const char *, ...);
__extern int vsscanf(const char *, const char *, va_list);
--
1.6.5.rc2
Apparently Analagous Threads
- [PATCH 1/2] Fix must_inline macro in klibc/compiler.h for gcc-4.3
- [RFC] Usage of NDEBUG as a guard for non-assert debug code
- Question: Should we consider valid a variable defined #ifndef NDEBUG scope and used in assert?
- Question: Should we consider valid a variable defined #ifndef NDEBUG scope and used in assert?
- [RFC] Usage of NDEBUG as a guard for non-assert debug code