summaryrefslogtreecommitdiff
path: root/unittest
diff options
context:
space:
mode:
authorunknown <serg@janus.mylan>2007-12-20 23:58:09 +0100
committerunknown <serg@janus.mylan>2007-12-20 23:58:09 +0100
commit3e756a80d4d9beb7b8a990362ff68d9aad858955 (patch)
tree78a4fa0c1facfa3ee4ad32264ed3fa7d5c3a198e /unittest
parent295732b580716b6b5a48a4a2ceb112b432c96551 (diff)
downloadmariadb-git-3e756a80d4d9beb7b8a990362ff68d9aad858955.tar.gz
my_atomic-t.c:
gcc bug workaround unittest/mysys/my_atomic-t.c: gcc bug workaround
Diffstat (limited to 'unittest')
-rw-r--r--unittest/mysys/my_atomic-t.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/unittest/mysys/my_atomic-t.c b/unittest/mysys/my_atomic-t.c
index a9e98a95cdb..f2bcd360508 100644
--- a/unittest/mysys/my_atomic-t.c
+++ b/unittest/mysys/my_atomic-t.c
@@ -18,6 +18,13 @@
#include <my_atomic.h>
#include <tap.h>
+/* at least gcc 3.4.5 and 3.4.6 (but not 3.2.3) on RHEL */
+#if __GNUC__ == 3 && __GNUC_MINOR__ == 4
+#define GCC_BUG_WORKAROUND volatile
+#else
+#define GCC_BUG_WORKAROUND
+#endif
+
int32 a32,b32,c32;
my_atomic_rwlock_t rwl;
@@ -30,7 +37,7 @@ int N;
pthread_handler_t test_atomic_add_handler(void *arg)
{
int m=*(int *)arg;
- int32 x;
+ GCC_BUG_WORKAROUND int32 x;
for (x=((int)((long)(&m))); m ; m--)
{
x=x*m+0x87654321;
@@ -102,7 +109,7 @@ pthread_handler_t test_atomic_swap_handler(void *arg)
pthread_handler_t test_atomic_cas_handler(void *arg)
{
int m=*(int *)arg, ok;
- int32 x,y;
+ GCC_BUG_WORKAROUND int32 x,y;
for (x=((int)((long)(&m))); m ; m--)
{
my_atomic_rwlock_wrlock(&rwl);