src: Add support for compile flag -Wstrict-prototypes
authorAdrian Friedli <adrian.friedli@husqvarnagroup.com>
Tue, 25 Oct 2016 08:57:21 +0000 (10:57 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Sat, 12 Nov 2016 11:13:55 +0000 (12:13 +0100)
example/allocate_module_test.c
example/customer_database_test.c
src/cmocka.c

index cd5d371325f7d096a4c74a75fb3b478783078b8b..562aea2fd3598255b6d8c7187d5e99e183dd1934 100644 (file)
@@ -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) {
index 2f78b05a5bb2eedcc14c0dc9dba05a20ec7376e8..45ec782c71c46941ef2f602ff8dadf600312f209 100644 (file)
@@ -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);
 
index 6c79a208b3d11e9593eceefd49f41ed15df824fe..a74a8e5274faa1a674cb7301e1f635033a24c1b9 100644 (file)
@@ -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;
 }