diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-10 12:40:48 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-10 12:40:48 +0200 |
commit | bac929b99b4a9ca0fd16d696175692b6545907c5 (patch) | |
tree | 3f576f12aa156a768dfe2191d85cad772ec0383a | |
parent | bc9bbeb2b81001e8731cd2ae501c8fccc8d87cc7 (diff) | |
download | busybox-w32-bac929b99b4a9ca0fd16d696175692b6545907c5.tar.gz busybox-w32-bac929b99b4a9ca0fd16d696175692b6545907c5.tar.bz2 busybox-w32-bac929b99b4a9ca0fd16d696175692b6545907c5.zip |
Hopefully fix "will break strict-aliasing rules" warning for get_le32
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | include/platform.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/platform.h b/include/platform.h index b81c59d4e..c365d5c8c 100644 --- a/include/platform.h +++ b/include/platform.h | |||
@@ -260,6 +260,11 @@ typedef uint64_t bb__aliased_uint64_t FIX_ALIASING; | |||
260 | #define put_unaligned_le32(val, buf) move_to_unaligned32(buf, SWAP_LE32(val)) | 260 | #define put_unaligned_le32(val, buf) move_to_unaligned32(buf, SWAP_LE32(val)) |
261 | #define put_unaligned_be32(val, buf) move_to_unaligned32(buf, SWAP_BE32(val)) | 261 | #define put_unaligned_be32(val, buf) move_to_unaligned32(buf, SWAP_BE32(val)) |
262 | 262 | ||
263 | /* unxz needs an aligned fixed-endian accessor. | ||
264 | * (however, the compiler does not realize it's aligned, the cast is still necessary) | ||
265 | */ | ||
266 | #define get_le32(u32p) ({ uint32_t v = *(bb__aliased_uint32_t*)(u32p); SWAP_LE32(v); }) | ||
267 | |||
263 | 268 | ||
264 | /* ---- Size-saving "small" ints (arch-dependent) ----------- */ | 269 | /* ---- Size-saving "small" ints (arch-dependent) ----------- */ |
265 | 270 | ||