From: Denys Vlasenko Date: Tue, 19 Feb 2013 16:39:56 +0000 (+0100) Subject: Fix compiler warnings X-Git-Tag: v4.8~135 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2544f988c96a48e48369a767d8886c4282859ed3;p=strace Fix compiler warnings 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 --- diff --git a/syscall.c b/syscall.c index a1e33e1a..158fe896 100644 --- 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 9199f261..f0d024d4 100644 --- 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