From d0dc3489dc701036ee5e077964851a34f449029a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Esser?= Date: Mon, 13 Apr 2020 11:29:52 +0200 Subject: [PATCH] Enforce strict prototypes. --- CMakeLists.txt | 1 + json_object.c | 2 +- json_object.h | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 60f529a..04d21f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -240,6 +240,7 @@ if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wwrite-strings") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wstrict-prototypes") add_definitions(-D_GNU_SOURCE) elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC") diff --git a/json_object.c b/json_object.c index 4edfae9..e65ea04 100644 --- a/json_object.c +++ b/json_object.c @@ -1373,7 +1373,7 @@ static int json_array_equal(struct json_object *jso1, struct json_object *jso2) return 1; } -struct json_object *json_object_new_null() +struct json_object *json_object_new_null(void) { return NULL; } diff --git a/json_object.h b/json_object.h index 17fc3fc..7c0d1f2 100644 --- a/json_object.h +++ b/json_object.h @@ -940,7 +940,7 @@ JSON_EXPORT int json_object_set_string_len(json_object *obj, const char *new_val * along the lines of the other json_object_new_* functions. * It always returns NULL, and it is entirely acceptable to simply use NULL directly. */ -JSON_EXPORT struct json_object *json_object_new_null(); +JSON_EXPORT struct json_object *json_object_new_null(void); /** Check if two json_object's are equal * -- 2.40.0