[git commit nptl] assert: make linenumber unsigned

Peter S. Mazinger ps.m at gmx.net
Sun Nov 22 08:37:56 UTC 2009


commit: http://git.uclibc.org/uClibc/commit/?id=4fb2e2c314c475a59024acbc94a5f8dd3086390a
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/nptl

Move attribute_noreturn to header.

Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
Signed-off-by: Austin Foxley <austinf at cetoncorp.com>
---
 include/assert.h            |    8 ++++----
 libc/misc/assert/__assert.c |    7 +++----
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/include/assert.h b/include/assert.h
index 439179d..40b1605 100644
--- a/include/assert.h
+++ b/include/assert.h
@@ -51,15 +51,15 @@
 __BEGIN_DECLS
 
 /* This prints an "Assertion failed" message and aborts.  */
-extern void __assert __P((const char *, const char *, int, const char *));
+extern void __assert(const char *, const char *, unsigned int, const char *)
+	__THROW __attribute__ ((__noreturn__));
 libc_hidden_proto(__assert)
 
 __END_DECLS
 
 # define assert(expr) \
-  (__ASSERT_VOID_CAST ((expr) ? 0 :					      \
-		       (__assert (__STRING(expr), __FILE__, __LINE__,    \
-				       __ASSERT_FUNCTION), 0)))
+  (__ASSERT_VOID_CAST ((expr) ? 0 :								\
+		       (__assert (__STRING(expr), __FILE__, __LINE__, __ASSERT_FUNCTION), 0)))
 
 /* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
    which contains the name of the function currently being defined.
diff --git a/libc/misc/assert/__assert.c b/libc/misc/assert/__assert.c
index ff9e47d..18c6f5e 100644
--- a/libc/misc/assert/__assert.c
+++ b/libc/misc/assert/__assert.c
@@ -29,8 +29,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
-#include <bits/uClibc_uintmaxtostr.h>
 
 
 /* Get the prototype from assert.h as a double-check. */
@@ -43,8 +41,8 @@
 
 static smallint in_assert;			/* bss inits to 0. */
 
-void attribute_noreturn __assert(const char *assertion, const char * filename,
-			  int linenumber, register const char * function)
+void __assert(const char *assertion, const char * filename,
+	      unsigned int linenumber, register const char * function)
 {
 	if (!in_assert) {
 		in_assert = 1;
@@ -62,6 +60,7 @@ void attribute_noreturn __assert(const char *assertion, const char * filename,
 				assertion
 				);
 	}
+	/* shouldn't we? fflush(stderr); */
 	abort();
 }
 
-- 
1.6.3.3



More information about the uClibc-cvs mailing list