diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2015-05-24 01:49:51 +0400 |
---|---|---|
committer | Konstantin Ritt <ritt.ks@gmail.com> | 2015-05-26 10:10:56 +0000 |
commit | 2a9856781688fdf7bb16b132c631c6ec7b8f3c18 (patch) | |
tree | 1579de1ed0c68ca5f579f50ac2a9da61535e5816 | |
parent | d609cf62916883d82abad80aad5f9f4bd937e030 (diff) |
Fix GCC warning
The actual message was:
> warning: dereferencing type-punned pointer will break strict-aliasing
rules [-Wstrict-aliasing]
Change-Id: I70f30da77a925e50032c5a82014af2e1aee511fb
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
-rw-r--r-- | src/bluetooth/qbluetoothuuid.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/bluetooth/qbluetoothuuid.cpp b/src/bluetooth/qbluetoothuuid.cpp index bbb9f652..cfce871c 100644 --- a/src/bluetooth/qbluetoothuuid.cpp +++ b/src/bluetooth/qbluetoothuuid.cpp @@ -587,9 +587,12 @@ QBluetoothUuid::QBluetoothUuid(quint32 uuid) */ QBluetoothUuid::QBluetoothUuid(quint128 uuid) { +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wstrict-aliasing") data1 = qFromBigEndian<quint32>(*reinterpret_cast<quint32 *>(&uuid.data[0])); data2 = qFromBigEndian<quint16>(*reinterpret_cast<quint16 *>(&uuid.data[4])); data3 = qFromBigEndian<quint16>(*reinterpret_cast<quint16 *>(&uuid.data[6])); +QT_WARNING_POP memcpy(data4, &uuid.data[8], 8); } |