Add -Wextra to CFLAGS
authorMichael Jeanson <mjeanson@efficios.com>
Fri, 30 Nov 2018 19:28:51 +0000 (14:28 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 12 Dec 2018 15:28:18 +0000 (10:28 -0500)
Edited by Mathieu Desnoyers:

Use /* fall through */ rather than __attribute__((fallthrough)) to
stay compatible with clang and gcc < 7. The fallthrough attribute
was introduced in gcc 7.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
configure.ac
doc/examples/rculfhash/jhash.h
tests/benchmark/test_urcu_hash.h
tests/regression/rcutorture.h

index 8e7ff4c15b4f8914f5de15290e506347565f7387..4d1a1dfe659beffbbaf9f24a39dac775ca4348c6 100644 (file)
@@ -373,7 +373,7 @@ AC_CHECK_FUNCS([sched_setaffinity],[
 AM_CPPFLAGS="-include config.h"
 AC_SUBST(AM_CPPFLAGS)
 
-AM_CFLAGS="-Wall $AM_CFLAGS"
+AM_CFLAGS="-Wall -Wextra -Wno-unused-parameter -Wno-sign-compare $AM_CFLAGS"
 AC_SUBST(AM_CFLAGS)
 
 AC_CONFIG_LINKS([
index 673989df4ca42f14802944d39792cad98aa54368..5e8b288231389a0473d815f904d7ff1033745dc9 100644 (file)
@@ -226,17 +226,17 @@ uint32_t hashlittle(const void *key, size_t length, uint32_t initval)
 
                /*-------------------------------- last block: affect all 32 bits of (c) */
                switch (length) {                /* all the case statements fall through */
-               case 12: c+=((uint32_t) k[11])<<24;
-               case 11: c+=((uint32_t) k[10])<<16;
-               case 10: c+=((uint32_t) k[9])<<8;
-               case 9 : c+=k[8];
-               case 8 : b+=((uint32_t) k[7])<<24;
-               case 7 : b+=((uint32_t) k[6])<<16;
-               case 6 : b+=((uint32_t) k[5])<<8;
-               case 5 : b+=k[4];
-               case 4 : a+=((uint32_t) k[3])<<24;
-               case 3 : a+=((uint32_t) k[2])<<16;
-               case 2 : a+=((uint32_t) k[1])<<8;
+               case 12: c+=((uint32_t) k[11])<<24; /* fall through */
+               case 11: c+=((uint32_t) k[10])<<16; /* fall through */
+               case 10: c+=((uint32_t) k[9])<<8; /* fall through */
+               case 9 : c+=k[8]; /* fall through */
+               case 8 : b+=((uint32_t) k[7])<<24; /* fall through */
+               case 7 : b+=((uint32_t) k[6])<<16; /* fall through */
+               case 6 : b+=((uint32_t) k[5])<<8; /* fall through */
+               case 5 : b+=k[4]; /* fall through */
+               case 4 : a+=((uint32_t) k[3])<<24; /* fall through */
+               case 3 : a+=((uint32_t) k[2])<<16; /* fall through */
+               case 2 : a+=((uint32_t) k[1])<<8; /* fall through */
                case 1 : a+=k[0];
                         break;
                case 0 : return c;
index 2f708a115cd412bf620cbeda9e1b068b1c399b48..023ae1c4a06fe4aeb24338e59bd11a905cdabd9a 100644 (file)
@@ -285,10 +285,11 @@ void hashword2(
 
        /*----------------------------------- handle the last 3 uint32_t's */
        switch (length) {       /* all the case statements fall through */
-       case 3: c += k[2];
-       case 2: b += k[1];
+       case 3: c += k[2]; /* fall through */
+       case 2: b += k[1]; /* fall through */
        case 1: a += k[0];
                final(a, b, c);
+               /* fall through */
        case 0:                 /* case 0: nothing left to add */
                break;
        }
index db3dfad00785a5aede0aa486d2805b5ed67a8814..9a2f9a1f581ffc5c34e4ce0c5f2ed2a12e114b75 100644 (file)
@@ -113,13 +113,13 @@ volatile int goflag __attribute__((__aligned__(CAA_CACHE_LINE_SIZE)))
 #endif
 
 #ifndef mark_rcu_quiescent_state
-#define mark_rcu_quiescent_state() do ; while (0)
+#define mark_rcu_quiescent_state() do {} while (0)
 #endif /* #ifdef mark_rcu_quiescent_state */
 
 #ifndef put_thread_offline
-#define put_thread_offline()           do ; while (0)
-#define put_thread_online()            do ; while (0)
-#define put_thread_online_delay()      do ; while (0)
+#define put_thread_offline()           do {} while (0)
+#define put_thread_online()            do {} while (0)
+#define put_thread_online_delay()      do {} while (0)
 #else /* #ifndef put_thread_offline */
 #define put_thread_online_delay()      synchronize_rcu()
 #endif /* #else #ifndef put_thread_offline */
This page took 0.027097 seconds and 4 git commands to generate.