From 670187f06afb257223d688feecdcdac8161a2b27 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Wed, 24 Nov 2021 09:27:04 +0900 Subject: [PATCH] fix -Wstrict-prototypes warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit function declarations should always explicitly say no argument is expected, as in C 'foo bar()' means bar can take any parameter. This was noticed when building another project with -Wall -Wextra and getting the following warning on installed header: /usr/include/zck.h:66:5: warning: function declaration isn’t a prototype [-Wstrict-prototypes] 66 | __attribute__ ((warn_unused_result)); | ^~~~~~~~~~~~~ /usr/include/zck.h:325:5: warning: function declaration isn’t a prototype [-Wstrict-prototypes] 325 | __attribute__ ((warn_unused_result)); | ^~~~~~~~~~~~~ --- include/zck.h.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/zck.h.in b/include/zck.h.in index 64e2ba1..17b7d20 100644 --- a/include/zck.h.in +++ b/include/zck.h.in @@ -62,7 +62,7 @@ typedef size_t (*zck_wcb)(void *ptr, size_t l, size_t c, void *dl_v); * Reading a zchunk file *******************************************************************/ /* Initialize zchunk context */ -zckCtx *zck_create() +zckCtx *zck_create(void) __attribute__ ((warn_unused_result)); /* Initialize zchunk for reading */ bool zck_init_read (zckCtx *zck, int src_fd) @@ -321,7 +321,7 @@ char *zck_get_range(size_t start, size_t end) __attribute__ ((warn_unused_result)); /* Get the minimum size needed to download in order to know how large the header * is */ -int zck_get_min_download_size() +int zck_get_min_download_size(void) __attribute__ ((warn_unused_result)); /* Get the number of separate range items in the range */ int zck_get_range_count(zckRange *range) -- 2.30.2