From 2e03f6fe1cc24d36c1eb6bb9eb90095905ee243c Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 2 Nov 2015 13:48:31 -0700 Subject: [PATCH] build: enable strict prototypes warning This catches functions with empty parameter lists, which are not the same as void parameter lists in C, as well as other (less-likely) K&R-style parameter lists. Change-Id: I18b09e01a60b3669d1cc5d8d96eec20cd872c497 Signed-off-by: Daniel Verkamp --- mk/spdk.common.mk | 2 +- test/lib/memory/vtophys.c | 4 ++-- .../nvme/unit/nvme_ctrlr_cmd_c/nvme_ctrlr_cmd_ut.c | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mk/spdk.common.mk b/mk/spdk.common.mk index b5987033a2..c1975acaa2 100644 --- a/mk/spdk.common.mk +++ b/mk/spdk.common.mk @@ -43,7 +43,7 @@ endif OS := $(shell uname) -COMMON_CFLAGS = -g $(C_OPT) -Wall -Wextra -Wno-unused-parameter -Wmissing-declarations -Werror -fno-strict-aliasing -march=native -m64 -I$(SPDK_ROOT_DIR)/include +COMMON_CFLAGS = -g $(C_OPT) -Wall -Wextra -Wno-unused-parameter -Wmissing-declarations -Wstrict-prototypes -Werror -fno-strict-aliasing -march=native -m64 -I$(SPDK_ROOT_DIR)/include COMMON_CFLAGS += -Wformat -Wformat-security -Wformat-nonliteral diff --git a/test/lib/memory/vtophys.c b/test/lib/memory/vtophys.c index 7cbdf7e22a..627da2351d 100644 --- a/test/lib/memory/vtophys.c +++ b/test/lib/memory/vtophys.c @@ -50,7 +50,7 @@ static const char *ealargs[] = { }; static int -vtophys_negative_test() +vtophys_negative_test(void) { void *p = NULL; int i; @@ -82,7 +82,7 @@ vtophys_negative_test() } static int -vtophys_positive_test() +vtophys_positive_test(void) { void *p = NULL; int i; diff --git a/test/lib/nvme/unit/nvme_ctrlr_cmd_c/nvme_ctrlr_cmd_ut.c b/test/lib/nvme/unit/nvme_ctrlr_cmd_c/nvme_ctrlr_cmd_ut.c index c0737f25dd..58617e912f 100644 --- a/test/lib/nvme/unit/nvme_ctrlr_cmd_c/nvme_ctrlr_cmd_ut.c +++ b/test/lib/nvme/unit/nvme_ctrlr_cmd_c/nvme_ctrlr_cmd_ut.c @@ -160,7 +160,7 @@ nvme_ctrlr_submit_admin_request(struct nvme_controller *ctrlr, struct nvme_reque static void -test_firmware_get_log_page() +test_firmware_get_log_page(void) { struct nvme_controller ctrlr = {}; struct nvme_firmware_page payload = {}; @@ -171,7 +171,7 @@ test_firmware_get_log_page() } static void -test_health_get_log_page() +test_health_get_log_page(void) { struct nvme_controller ctrlr = {}; struct nvme_health_information_page payload = {}; @@ -182,7 +182,7 @@ test_health_get_log_page() } static void -test_error_get_log_page() +test_error_get_log_page(void) { struct nvme_controller ctrlr = {}; struct nvme_error_information_entry payload = {}; @@ -197,7 +197,7 @@ test_error_get_log_page() } static void -test_set_feature_cmd() +test_set_feature_cmd(void) { struct nvme_controller ctrlr = {}; @@ -208,7 +208,7 @@ test_set_feature_cmd() static void -test_get_feature_cmd() +test_get_feature_cmd(void) { struct nvme_controller ctrlr = {}; @@ -218,7 +218,7 @@ test_get_feature_cmd() } static void -test_abort_cmd() +test_abort_cmd(void) { struct nvme_controller ctrlr = {}; @@ -228,7 +228,7 @@ test_abort_cmd() } static void -test_io_raw_cmd() +test_io_raw_cmd(void) { struct nvme_controller ctrlr = {}; struct nvme_command cmd = {};