summaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
authorDenys Vlasenko2010-02-04 15:00:15 +0100
committerDenys Vlasenko2010-02-04 15:00:15 +0100
commit98a4c7cf3d799ab953cb77e8b34597c73e3e7335 (patch)
tree2d9c07825697cd7c6e96647ff0992dce4d4a0115 /archival
parent1821d188ca674b42bf0f384b0c2332ff95701bba (diff)
downloadbusybox-98a4c7cf3d799ab953cb77e8b34597c73e3e7335.zip
busybox-98a4c7cf3d799ab953cb77e8b34597c73e3e7335.tar.gz
*: 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 982404d..d5b86ff 100644
--- a/archival/libunarchive/get_header_tar.c
+++ b/archival/libunarchive/get_header_tar.c
@@ -14,6 +14,10 @@
#include "libbb.h"
#include "unarchive.h"
+typedef uint32_t aliased_uint32_t FIX_ALIASING;
+typedef off_t aliased_off_t FIX_ALIASING;
+
+
/*
* GNU tar uses "base-256 encoding" for very large numbers (>8 billion).
* Encoding is binary, with highest bit always set as a marker
@@ -68,10 +72,10 @@ static off_t getBase256_len12(const char *str)
* and fetch it in one go:
*/
if (sizeof(off_t) == 8) {
- value = *(off_t*)str;
+ value = *(aliased_off_t*)str;
value = SWAP_BE64(value);
} else if (sizeof(off_t) == 4) {
- value = *(off_t*)str;
+ value = *(aliased_off_t*)str;
value = SWAP_BE32(value);
} else {
value = 0;
@@ -156,7 +160,7 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
#if ENABLE_DESKTOP || ENABLE_FEATURE_TAR_AUTODETECT
/* to prevent misdetection of bz2 sig */
- *(uint32_t*)(&tar) = 0;
+ *(aliased_uint32_t*)&tar = 0;
i = full_read(archive_handle->src_fd, &tar, 512);
/* If GNU tar sees EOF in above read, it says:
* "tar: A lone zero block at N", where N = kilobyte
diff --git a/archival/lzop.c b/archival/lzop.c
index a752a9d..0a15c51 100644
--- a/archival/lzop.c
+++ b/archival/lzop.c
@@ -396,7 +396,7 @@ struct globals {
const uint32_t *lzo_crc32_table;
chksum_t chksum_in;
chksum_t chksum_out;
-};
+} FIX_ALIASING;
#define G (*(struct globals*)&bb_common_bufsiz1)
#define INIT_G() do { } while (0)
//#define G (*ptr_to_globals)