From: Bart Van Assche Date: Wed, 12 Aug 2009 14:56:01 +0000 (+0000) Subject: Fixed more gcc warnings about type-punned pointers breaking strict X-Git-Tag: svn/VALGRIND_3_5_0~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44432a5c42e9ef8b22f8bc223509c37a47650bc5;p=thirdparty%2Fvalgrind.git Fixed more gcc warnings about type-punned pointers breaking strict aliasing / reworked changes applied through previous commit. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10796 --- diff --git a/drd/tests/tsan_unittest.cpp b/drd/tests/tsan_unittest.cpp index f7cc44d119..04d6f52808 100644 --- a/drd/tests/tsan_unittest.cpp +++ b/drd/tests/tsan_unittest.cpp @@ -3536,8 +3536,19 @@ int GLOB = 0; const int N_iter = 2; const int Nlog = 16; const int N = 1 << Nlog; -static int64_t ARR1[N]; -static int ARR2[N]; +union uint64_union { + uint64_t u64[1]; + uint32_t u32[2]; + uint16_t u16[4]; + uint8_t u8 [8]; +}; +static uint64_union ARR1[N]; +union uint32_union { + uint32_t u32[1]; + uint16_t u16[2]; + uint8_t u8 [4]; +}; +static uint32_union ARR2[N]; Barrier *barriers[N_iter]; Mutex MU; @@ -3558,15 +3569,15 @@ void Worker() { if (i & (1 << n)) { for (int off = 0; off < (1 << x); off++) { switch(x) { - case 0: CHECK( ARR1 [i * (1<