Fix some compiler warnings emitted by gcc-4.8.0
authorDenys Vlasenko <vda.linux@googlemail.com>
Wed, 16 Oct 2013 12:21:20 +0000 (14:21 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Wed, 16 Oct 2013 12:21:20 +0000 (14:21 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
archival/libarchive/bz/compress.c
archival/libarchive/lzo1x_9x.c
debianutils/run_parts.c
networking/ping.c

index e9f1afdaf3c0b2988d0b1f014f7cb10f7b688bc2..a7dd72d9eaa598c5e1ab446b492a17e7978b16cb 100644 (file)
@@ -501,14 +501,14 @@ void sendMTFValues(EState* s)
                for (i = 0; i < 16; i++) {
                        if (sizeof(long) <= 4) {
                                inUse16 = inUse16*2 +
-                                       ((*(uint32_t*)&(s->inUse[i * 16 + 0])
-                                       | *(uint32_t*)&(s->inUse[i * 16 + 4])
-                                       | *(uint32_t*)&(s->inUse[i * 16 + 8])
-                                       | *(uint32_t*)&(s->inUse[i * 16 + 12])) != 0);
+                                       ((*(bb__aliased_uint32_t*)&(s->inUse[i * 16 + 0])
+                                       | *(bb__aliased_uint32_t*)&(s->inUse[i * 16 + 4])
+                                       | *(bb__aliased_uint32_t*)&(s->inUse[i * 16 + 8])
+                                       | *(bb__aliased_uint32_t*)&(s->inUse[i * 16 + 12])) != 0);
                        } else { /* Our CPU can do better */
                                inUse16 = inUse16*2 +
-                                       ((*(uint64_t*)&(s->inUse[i * 16 + 0])
-                                       | *(uint64_t*)&(s->inUse[i * 16 + 8])) != 0);
+                                       ((*(bb__aliased_uint64_t*)&(s->inUse[i * 16 + 0])
+                                       | *(bb__aliased_uint64_t*)&(s->inUse[i * 16 + 8])) != 0);
                        }
                }
 
index 897132987c5c3e710066895be46e2bd1a00a395d..3e331984db044aebabcabcff04f0bd5407411cfa 100644 (file)
@@ -94,7 +94,7 @@ typedef struct {
        ( ((0x9f5f * ((((b[p]<<5)^b[p+1])<<5) ^ b[p+2])) >> 5) & (SWD_HSIZE-1) )
 
 #if defined(LZO_UNALIGNED_OK_2)
-#  define HEAD2(b,p)      (* (uint16_t *) &(b[p]))
+#  define HEAD2(b,p)      (* (bb__aliased_uint16_t *) &(b[p]))
 #else
 #  define HEAD2(b,p)      (b[p] ^ ((unsigned)b[p+1]<<8))
 #endif
index 2c2b032be7f18576a7d67883104c32c3d00d45f5..527fae227c5121d8265531c7e2fcdd057eb0952e 100644 (file)
@@ -59,7 +59,7 @@
 struct globals {
        char **names;
        int    cur;
-       char  *cmd[1];
+       char  *cmd[2 /* using 1 provokes compiler warning */];
 } FIX_ALIASING;
 #define G (*(struct globals*)&bb_common_bufsiz1)
 #define names (G.names)
index f27e2143de0742f62ba775bfab85b86028611f7b..5e4771f5a03f762e2d0ebf1526aa50ba92d93de6 100644 (file)
@@ -516,7 +516,7 @@ static void sendping6(int junk UNUSED_PARAM)
        pkt->icmp6_id = myid;
 
        /*if (datalen >= 4)*/
-               *(uint32_t*)(&pkt->icmp6_data8[4]) = monotonic_us();
+               *(bb__aliased_uint32_t*)(&pkt->icmp6_data8[4]) = monotonic_us();
 
        //TODO? pkt->icmp_cksum = inet_cksum(...);