]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: enable -Wextra and fix warnings caused by it
authorJohannes Berg <johannes.berg@intel.com>
Tue, 22 May 2018 20:23:32 +0000 (22:23 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 22 May 2018 20:23:44 +0000 (22:23 +0200)
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Makefile
event.c
mesh.c
scan.c
util.c

index 43c034dcbec92178b110da45ac14de2b8a1892ee..00d7bf33834d6329e4ed6844fe2e24149b90c512 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,8 +10,8 @@ INSTALL ?= install
 CC ?= "gcc"
 
 CFLAGS ?= -O2 -g
-CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common \
-         -Werror-implicit-function-declaration -Wsign-compare
+CFLAGS += -Wall -Wextra -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common \
+         -Werror-implicit-function-declaration -Wsign-compare -Wno-unused-parameter
 
 OBJS = iw.o genl.o event.o info.o phy.o \
        interface.o ibss.o station.o survey.o util.o ocb.o \
diff --git a/event.c b/event.c
index 3842c5c0000ba3c8229d7b1c5998afa2e569d037..aa6a34804eaa1bcc8bf20a23ff0a82dde2bb87eb 100644 (file)
--- a/event.c
+++ b/event.c
@@ -350,6 +350,7 @@ static int print_event(struct nl_msg *msg, void *arg)
                break;
        case NL80211_CMD_NEW_SCAN_RESULTS:
                printf("scan finished:");
+               /* fall through */
        case NL80211_CMD_SCAN_ABORTED:
                if (gnlh->cmd == NL80211_CMD_SCAN_ABORTED)
                        printf("scan aborted:");
diff --git a/mesh.c b/mesh.c
index 97f236b54cf6acbcf9d1c90fe3c2164a9c006005..f7564fc079fc6070d0b23ac5e1e9fb41618c0928 100644 (file)
--- a/mesh.c
+++ b/mesh.c
@@ -193,7 +193,7 @@ static void _print_s32_in_dBm(struct nlattr *a)
 
 
 /* The current mesh parameters */
-const static struct mesh_param_descr _mesh_param_descrs[] =
+static const struct mesh_param_descr _mesh_param_descrs[] =
 {
        {"mesh_retry_timeout",
        NL80211_MESHCONF_RETRY_TIMEOUT,
diff --git a/scan.c b/scan.c
index ec4e1e6b9940c6d06a49401694ea3913572b374d..09b04a5eb352162816032afed69f040f1a1b1a59 100644 (file)
--- a/scan.c
+++ b/scan.c
@@ -476,6 +476,7 @@ static int handle_scan(struct nl80211_state *state,
                                parse = DURATION;
                                break;
                        }
+                       /* fall through - this is an error */
                case DONE:
                        nlmsg_free(ssids);
                        nlmsg_free(freqs);
@@ -1852,6 +1853,7 @@ static inline void print_p2p(const uint8_t type, uint8_t len,
                                printf("\t * malformed device info\n");
                                break;
                        }
+
                        /* fall through for now */
                case 0x00: /* status */
                case 0x01: /* minor reason */
diff --git a/util.c b/util.c
index 6e0ddffe15969d417dd10fff392e933585ce155f..5b286b78117e475c391203b9c8c965041c894234 100644 (file)
--- a/util.c
+++ b/util.c
@@ -518,12 +518,14 @@ int parse_keys(struct nl_msg *msg, char **argv, int argc)
                switch (strlen(keydata)) {
                case 10:
                        keydata = hex2bin(keydata, keybuf);
+                       /* fall through */
                case 5:
                        NLA_PUT_U32(msg, NL80211_KEY_CIPHER, 0x000FAC01);
                        keylen = 5;
                        break;
                case 26:
                        keydata = hex2bin(keydata, keybuf);
+                       /* fall through */
                case 13:
                        NLA_PUT_U32(msg, NL80211_KEY_CIPHER, 0x000FAC05);
                        keylen = 13;