From: Willy Tarreau Date: Sun, 6 Jul 2008 13:18:50 +0000 (+0200) Subject: [BUILD] silent a warning in unlikely() with gcc 4.x X-Git-Tag: v1.3.16-rc1~242 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75875a7c8c7348e90e373c007bafdedcc6253ab4;p=thirdparty%2Fhaproxy.git [BUILD] silent a warning in unlikely() with gcc 4.x The unlikely() implementation for gcc 4.x spits out a warning when a pointer is passed. Add a cast to unsigned long. --- diff --git a/include/common/ebtree.h b/include/common/ebtree.h index 5ef965be79..b737bc915f 100644 --- a/include/common/ebtree.h +++ b/include/common/ebtree.h @@ -329,7 +329,7 @@ static inline int fls64(unsigned long long x) * only work with ints and booleans though. */ #define likely(x) (x) -#define unlikely(x) (__builtin_expect((x), 0)) +#define unlikely(x) (__builtin_expect((unsigned long)(x), 0)) #endif #endif diff --git a/include/common/standard.h b/include/common/standard.h index dae7bd54f7..892f516e52 100644 --- a/include/common/standard.h +++ b/include/common/standard.h @@ -61,7 +61,7 @@ * only work with ints and booleans though. */ #define likely(x) (x) -#define unlikely(x) (__builtin_expect((x), 0)) +#define unlikely(x) (__builtin_expect((unsigned long)(x), 0)) #endif #endif