This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Don't macro-expand failed assertion expression
- From: David Kastrup <dak at gnu dot org>
- To: libc-alpha at sourceware dot org
- Cc: David Kastrup <dak at gnu dot org>
- Date: Tue, 3 Nov 2015 10:02:54 +0100
- Subject: [PATCH] Don't macro-expand failed assertion expression
- Authentication-results: sourceware.org; auth=none
[BZ #18604]
* assert/assert.h (assert): Don't macro-expand failed assertion
expression in error message.
* malloc/malloc.c (assert): Likewise.
---
ChangeLog | 8 ++++++++
assert/assert.h | 2 +-
malloc/malloc.c | 2 +-
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ab7aa69..a5de5e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-11-03 David Kastrup <dak@gnu.org>
+
+ [BZ #18604]
+ * assert/assert.h (assert): Don't macro-expand failed assertion
+ expression in error message.
+
+ * malloc/malloc.c (assert): Likewise.
+
2015-11-02 Joseph Myers <joseph@codesourcery.com>
* math/libm-test.inc (modf_test_data): Add more tests.
diff --git a/assert/assert.h b/assert/assert.h
index d04c58c..40b9848 100644
--- a/assert/assert.h
+++ b/assert/assert.h
@@ -85,7 +85,7 @@ __END_DECLS
# define assert(expr) \
((expr) \
? __ASSERT_VOID_CAST (0) \
- : __assert_fail (__STRING(expr), __FILE__, __LINE__, __ASSERT_FUNCTION))
+ : __assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION))
# ifdef __USE_GNU
# define assert_perror(errnum) \
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 35c8863..839263e 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -283,7 +283,7 @@
# define assert(expr) \
((expr) \
? ((void) 0) \
- : __malloc_assert (__STRING (expr), __FILE__, __LINE__, __func__))
+ : __malloc_assert (#expr, __FILE__, __LINE__, __func__))
extern const char *__progname;
--
2.5.0