Fix compiler warnings
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 19 Feb 2013 16:39:56 +0000 (17:39 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 19 Feb 2013 16:39:56 +0000 (17:39 +0100)
With constant current_wordsize == 4 and 32-bit longs,
gcc was spooked by "1ul << (8 * current_wordsize)" = "1ul << 32".

Make such places conditional on SIZEOF_LONG > 4.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
syscall.c
util.c

index a1e33e1a05c55234cf8e80b3a34bf0efe2b23d2f..158fe8968665501819d505f13afe40c3ec1553db 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -2041,7 +2041,7 @@ static inline int
 is_negated_errno(unsigned long int val)
 {
        unsigned long int max = -(long int) nerrnos;
-#if SUPPORTED_PERSONALITIES > 1
+#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4
        if (current_wordsize < sizeof(val)) {
                val = (unsigned int) val;
                max = (unsigned int) max;
diff --git a/util.c b/util.c
index 9199f261548e246af7a670cf489c40700291092e..f0d024d46292332db96e6f346fbf969062d54326 100644 (file)
--- a/util.c
+++ b/util.c
@@ -767,7 +767,7 @@ umoven(struct tcb *tcp, long addr, int len, char *laddr)
                char x[sizeof(long)];
        } u;
 
-#if SUPPORTED_PERSONALITIES > 1
+#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4
        if (current_wordsize < sizeof(addr))
                addr &= (1ul << 8 * current_wordsize) - 1;
 #endif
@@ -859,7 +859,7 @@ umovestr(struct tcb *tcp, long addr, int len, char *laddr)
                char x[sizeof(long)];
        } u;
 
-#if SUPPORTED_PERSONALITIES > 1
+#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4
        if (current_wordsize < sizeof(addr))
                addr &= (1ul << 8 * current_wordsize) - 1;
 #endif