summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Friedli <adrian.friedli@husqvarnagroup.com>2016-10-25 10:57:21 +0200
committerAndreas Schneider <asn@cryptomilk.org>2016-11-12 12:13:55 +0100
commit70ecc58201ab7c20f268cd563618a9fa1f69e0d4 (patch)
tree8ac5c6ff52a8a966a846cf437187f3a8996f3f37
parent5182612d58b1670008b37f64fc92fc32382bd2d5 (diff)
downloadcmocka-70ecc58201ab7c20f268cd563618a9fa1f69e0d4.tar.gz
cmocka-70ecc58201ab7c20f268cd563618a9fa1f69e0d4.tar.bz2
cmocka-70ecc58201ab7c20f268cd563618a9fa1f69e0d4.zip
src: Add support for compile flag -Wstrict-prototypes
-rw-r--r--example/allocate_module_test.c6
-rw-r--r--example/customer_database_test.c2
-rw-r--r--src/cmocka.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/example/allocate_module_test.c b/example/allocate_module_test.c
index cd5d371..562aea2 100644
--- a/example/allocate_module_test.c
+++ b/example/allocate_module_test.c
@@ -18,9 +18,9 @@
#include <setjmp.h>
#include <cmocka.h>
-extern void leak_memory();
-extern void buffer_overflow();
-extern void buffer_underflow();
+extern void leak_memory(void);
+extern void buffer_overflow(void);
+extern void buffer_underflow(void);
/* Test case that fails as leak_memory() leaks a dynamically allocated block. */
static void leak_memory_test(void **state) {
diff --git a/example/customer_database_test.c b/example/customer_database_test.c
index 2f78b05..45ec782 100644
--- a/example/customer_database_test.c
+++ b/example/customer_database_test.c
@@ -19,7 +19,7 @@
#include <cmocka.h>
#include <database.h>
-extern DatabaseConnection* connect_to_customer_database();
+extern DatabaseConnection* connect_to_customer_database(void);
extern unsigned int get_customer_id_by_name(
DatabaseConnection * const connection, const char * const customer_name);
diff --git a/src/cmocka.c b/src/cmocka.c
index 6c79a20..a74a8e5 100644
--- a/src/cmocka.c
+++ b/src/cmocka.c
@@ -1730,7 +1730,7 @@ void _assert_not_in_set(const LargestIntegralType value,
/* Get the list of allocated blocks. */
-static ListNode* get_allocated_blocks_list() {
+static ListNode* get_allocated_blocks_list(void) {
/* If it initialized, initialize the list of allocated blocks. */
if (!global_allocated_blocks.value) {
list_initialize(&global_allocated_blocks);
@@ -1945,7 +1945,7 @@ void *_test_realloc(void *ptr,
#define realloc test_realloc
/* Crudely checkpoint the current heap state. */
-static const ListNode* check_point_allocated_blocks() {
+static const ListNode* check_point_allocated_blocks(void) {
return get_allocated_blocks_list()->prev;
}