aboutsummaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-02-04 15:00:15 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-02-04 15:00:15 +0100
commit98a4c7cf3d799ab953cb77e8b34597c73e3e7335 (patch)
tree2d9c07825697cd7c6e96647ff0992dce4d4a0115 /archival
parent1821d188ca674b42bf0f384b0c2332ff95701bba (diff)
downloadbusybox-w32-98a4c7cf3d799ab953cb77e8b34597c73e3e7335.tar.gz
busybox-w32-98a4c7cf3d799ab953cb77e8b34597c73e3e7335.tar.bz2
busybox-w32-98a4c7cf3d799ab953cb77e8b34597c73e3e7335.zip
*: suppress ~60% of "aliased warnings" on gcc-4.4.1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival')
-rw-r--r--archival/libunarchive/get_header_tar.c10
-rw-r--r--archival/lzop.c2
2 files changed, 8 insertions, 4 deletions
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c
index 982404d14..d5b86ff5c 100644
--- a/archival/libunarchive/get_header_tar.c
+++ b/archival/libunarchive/get_header_tar.c
@@ -14,6 +14,10 @@
14#include "libbb.h" 14#include "libbb.h"
15#include "unarchive.h" 15#include "unarchive.h"
16 16
17typedef uint32_t aliased_uint32_t FIX_ALIASING;
18typedef off_t aliased_off_t FIX_ALIASING;
19
20
17/* 21/*
18 * GNU tar uses "base-256 encoding" for very large numbers (>8 billion). 22 * GNU tar uses "base-256 encoding" for very large numbers (>8 billion).
19 * Encoding is binary, with highest bit always set as a marker 23 * Encoding is binary, with highest bit always set as a marker
@@ -68,10 +72,10 @@ static off_t getBase256_len12(const char *str)
68 * and fetch it in one go: 72 * and fetch it in one go:
69 */ 73 */
70 if (sizeof(off_t) == 8) { 74 if (sizeof(off_t) == 8) {
71 value = *(off_t*)str; 75 value = *(aliased_off_t*)str;
72 value = SWAP_BE64(value); 76 value = SWAP_BE64(value);
73 } else if (sizeof(off_t) == 4) { 77 } else if (sizeof(off_t) == 4) {
74 value = *(off_t*)str; 78 value = *(aliased_off_t*)str;
75 value = SWAP_BE32(value); 79 value = SWAP_BE32(value);
76 } else { 80 } else {
77 value = 0; 81 value = 0;
@@ -156,7 +160,7 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
156 160
157#if ENABLE_DESKTOP || ENABLE_FEATURE_TAR_AUTODETECT 161#if ENABLE_DESKTOP || ENABLE_FEATURE_TAR_AUTODETECT
158 /* to prevent misdetection of bz2 sig */ 162 /* to prevent misdetection of bz2 sig */
159 *(uint32_t*)(&tar) = 0; 163 *(aliased_uint32_t*)&tar = 0;
160 i = full_read(archive_handle->src_fd, &tar, 512); 164 i = full_read(archive_handle->src_fd, &tar, 512);
161 /* If GNU tar sees EOF in above read, it says: 165 /* If GNU tar sees EOF in above read, it says:
162 * "tar: A lone zero block at N", where N = kilobyte 166 * "tar: A lone zero block at N", where N = kilobyte
diff --git a/archival/lzop.c b/archival/lzop.c
index a752a9d89..0a15c51aa 100644
--- a/archival/lzop.c
+++ b/archival/lzop.c
@@ -396,7 +396,7 @@ struct globals {
396 const uint32_t *lzo_crc32_table; 396 const uint32_t *lzo_crc32_table;
397 chksum_t chksum_in; 397 chksum_t chksum_in;
398 chksum_t chksum_out; 398 chksum_t chksum_out;
399}; 399} FIX_ALIASING;
400#define G (*(struct globals*)&bb_common_bufsiz1) 400#define G (*(struct globals*)&bb_common_bufsiz1)
401#define INIT_G() do { } while (0) 401#define INIT_G() do { } while (0)
402//#define G (*ptr_to_globals) 402//#define G (*ptr_to_globals)