Comment 25 for bug 705689

Revision history for this message
Jani Monoses (jani) wrote : Re: QT applications crash with segfault error on armel (natty only)

The bug does not appear with 4.5 if a workaround is used.
At the end of the macro body get the volatile int field explicitely and return that.

--- kernel/qmetatype.h 2011-02-08 14:48:27.000000000 +0200
+++ qmetatype.h 2011-02-08 14:49:14.000000000 +0200
@@ -276,7 +276,8 @@
                 if (!metatype_id) \
                     metatype_id = qRegisterMetaType< TYPE >(#TYPE, \
                                reinterpret_cast< TYPE *>(quintptr(-1))); \
- return metatype_id; \
+ volatile int mid = metatype_id;\
+ return mid; \
             } \
     }; \
     QT_END_NAMESPACE