diff mbox

Don't macro-expand failed assertion expression

Message ID 1446541374-2063-1-git-send-email-dak@gnu.org
State New
Headers show

Commit Message

David Kastrup Nov. 3, 2015, 9:02 a.m. UTC
[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(-)

Comments

Florian Weimer Nov. 3, 2015, 10:26 p.m. UTC | #1
On 11/03/2015 10:02 AM, David Kastrup wrote:
> [BZ #18604]
> * assert/assert.h (assert): Don't macro-expand failed assertion
> expression in error message.
> 
> * malloc/malloc.c (assert): Likewise.

Thanks, committed and pushed.  (I'm assuming you don't have access to
sourceware.)

Florian
Joseph Myers Nov. 3, 2015, 10:44 p.m. UTC | #2
On Tue, 3 Nov 2015, Florian Weimer wrote:

> On 11/03/2015 10:02 AM, David Kastrup wrote:
> > [BZ #18604]
> > * assert/assert.h (assert): Don't macro-expand failed assertion
> > expression in error message.
> > 
> > * malloc/malloc.c (assert): Likewise.
> 
> Thanks, committed and pushed.  (I'm assuming you don't have access to
> sourceware.)

You need to update the list of fixed bugs in NEWS when committing a fix 
for a bug, since automatic generation of that list is not yet in use.  
And you need to set the milestone when marking a bug as fixed, so that 
when automatic generation is in use it gets included in the generated list 
of fixed bugs.  (I think there was consensus on the principle of automatic 
generation, even in the absence of any comments on the concrete 
implementation I proposed in 
<https://sourceware.org/ml/libc-alpha/2015-10/msg01043.html>.)
Florian Weimer Nov. 4, 2015, 7:09 a.m. UTC | #3
On 11/03/2015 11:44 PM, Joseph Myers wrote:
> On Tue, 3 Nov 2015, Florian Weimer wrote:
> 
>> On 11/03/2015 10:02 AM, David Kastrup wrote:
>>> [BZ #18604]
>>> * assert/assert.h (assert): Don't macro-expand failed assertion
>>> expression in error message.
>>>
>>> * malloc/malloc.c (assert): Likewise.
>>
>> Thanks, committed and pushed.  (I'm assuming you don't have access to
>> sourceware.)
> 
> You need to update the list of fixed bugs in NEWS when committing a fix 

Thanks, fixed.

Florian
Joseph Myers Nov. 4, 2015, 3:53 p.m. UTC | #4
On Wed, 4 Nov 2015, Florian Weimer wrote:

> On 11/03/2015 11:44 PM, Joseph Myers wrote:
> > On Tue, 3 Nov 2015, Florian Weimer wrote:
> > 
> >> On 11/03/2015 10:02 AM, David Kastrup wrote:
> >>> [BZ #18604]
> >>> * assert/assert.h (assert): Don't macro-expand failed assertion
> >>> expression in error message.
> >>>
> >>> * malloc/malloc.c (assert): Likewise.
> >>
> >> Thanks, committed and pushed.  (I'm assuming you don't have access to
> >> sourceware.)
> > 
> > You need to update the list of fixed bugs in NEWS when committing a fix 
> 
> Thanks, fixed.

The milestone setting still appears to be missing.
Joseph Myers Nov. 4, 2015, 4:26 p.m. UTC | #5
On Wed, 4 Nov 2015, Florian Weimer wrote:

> > You need to update the list of fixed bugs in NEWS when committing a fix 
> 
> Thanks, fixed.

You appear to have added it to the wrong section in NEWS (2.22 instead of 
2.23).
Florian Weimer Nov. 4, 2015, 4:50 p.m. UTC | #6
On 11/04/2015 05:26 PM, Joseph Myers wrote:
> On Wed, 4 Nov 2015, Florian Weimer wrote:
> 
>>> You need to update the list of fixed bugs in NEWS when committing a fix 
>>
>> Thanks, fixed.
> 
> You appear to have added it to the wrong section in NEWS (2.22 instead of 
> 2.23).

I'm sorry.  Clearly, today is not my day.  I moved the bug reference to
the right section, hopefully restoring the original list for 2.22 and
ordering the list for 2.23.  Would you please double-check?

Thanks,
Florian
Joseph Myers Nov. 4, 2015, 5:10 p.m. UTC | #7
On Wed, 4 Nov 2015, Florian Weimer wrote:

> On 11/04/2015 05:26 PM, Joseph Myers wrote:
> > On Wed, 4 Nov 2015, Florian Weimer wrote:
> > 
> >>> You need to update the list of fixed bugs in NEWS when committing a fix 
> >>
> >> Thanks, fixed.
> > 
> > You appear to have added it to the wrong section in NEWS (2.22 instead of 
> > 2.23).
> 
> I'm sorry.  Clearly, today is not my day.  I moved the bug reference to
> the right section, hopefully restoring the original list for 2.22 and
> ordering the list for 2.23.  Would you please double-check?

I think it's correct now.
diff mbox

Patch

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;