Patchwork [trans-mem] Fix compilation of libitm with recent gcc

login
register
mail settings
Submitter Patrick Marlier
Date Sept. 7, 2011, 3:37 p.m.
Message ID <4E678FA3.4070800@unine.ch>
Download mbox | patch
Permalink /patch/113775/
State New
Headers show

Comments

Patrick Marlier - Sept. 7, 2011, 3:37 p.m.
Here the error when gcc compiles libitm:

../../../transactional-memory/libitm/aatree.h: In constructor 
‘GTM::aa_node_base::aa_node_base(GTM::aa_node_base::level_type)’:
../../../transactional-memory/libitm/aatree.h:53:16: error: 
list-initializer for non-class type must not be parenthesized [-Werror]

The fix just consists to remove the parenthesis.

Patrick.
Aldy Hernandez - Sept. 14, 2011, 6:40 p.m.
Patrick Marlier <patrick.marlier@unine.ch> writes:

> Here the error when gcc compiles libitm:
>
> ../../../transactional-memory/libitm/aatree.h: In constructor
> ‘GTM::aa_node_base::aa_node_base(GTM::aa_node_base::level_type)’:
> ../../../transactional-memory/libitm/aatree.h:53:16: error:
> list-initializer for non-class type must not be parenthesized
> [-Werror]
>
> The fix just consists to remove the parenthesis.

I have run into the same problem while doing a merge from trunk.  This
will be fixed (with your patch ;-)) once I commit in the next few days.

Oh yeah, expect many changes to the branch once I commit.  We hadn't
done a merge in almost 1.5 years.

Thanks Patrick.

Patch

Index: aatree.h
===================================================================
--- aatree.h    (revision 178056)
+++ aatree.h    (working copy)
@@ -48,8 +48,8 @@ 

   public:
    aa_node_base(level_type l = 1)
-    : m_link({ const_cast<aa_node_base *>(&s_nil),
-            const_cast<aa_node_base *>(&s_nil) }),
+    : m_link { const_cast<aa_node_base *>(&s_nil),
+            const_cast<aa_node_base *>(&s_nil) },
        m_level(l)
    { }