From 0067abaaf14e845e491b0b5a9d9f57820a4e52cd Mon Sep 17 00:00:00 2001 From: Dariusz Michaluk Date: Wed, 8 Jun 2016 11:18:18 +0200 Subject: [PATCH] Remove no-unused-parameter compilation flag. Fix some errors. Change-Id: Ic091bff6f4936608cfb6d9a32b20e93fc59849b8 --- CMakeLists.txt | 2 -- examples/key_password.c | 2 +- src/crypto.c | 2 +- src/digest.c | 4 +++- src/internal.h | 1 + src/key.c | 2 +- src/sign.c | 2 +- 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e2b5e35..7b9cb1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,8 +59,6 @@ ADD_DEFINITIONS("-fPIC") # Position Independent Code ADD_DEFINITIONS("-Werror") # Make all warnings into errors ADD_DEFINITIONS("-Wall") # Generate all warnings ADD_DEFINITIONS("-Wextra") # Generate even more extra warnings -# TODO Remove 'no-unused-parameter' after API implementation -ADD_DEFINITIONS("-Wno-unused-parameter") # Supress unused parameter warning ADD_DEFINITIONS("-pedantic") # Be pedantic ADD_DEFINITIONS("-pedantic-errors") # Make pedantic warnings into errors ADD_DEFINITIONS(-DPROJECT_SOURCE_DIR="${PROJECT_SOURCE_DIR}") diff --git a/examples/key_password.c b/examples/key_password.c index 829797c..ef40fa2 100644 --- a/examples/key_password.c +++ b/examples/key_password.c @@ -76,7 +76,7 @@ exit: yaca_key_destroy(lkey); } -int main(int argc, char *argv[]) +int main() { int ret; yaca_key_h key = YACA_KEY_NULL; diff --git a/src/crypto.c b/src/crypto.c index 99fa1db..fc48c9e 100644 --- a/src/crypto.c +++ b/src/crypto.c @@ -37,7 +37,7 @@ static pthread_mutex_t *mutexes = NULL; -static void locking_callback(int mode, int type, const char *file, int line) +static void locking_callback(int mode, int type, UNUSED const char *file, UNUSED int line) { /* Ignore NULL mutexes and lock/unlock error codes as we can't do anything * about them. */ diff --git a/src/digest.c b/src/digest.c index 0191e96..235a0a2 100644 --- a/src/digest.c +++ b/src/digest.c @@ -50,7 +50,9 @@ static struct yaca_digest_ctx_s *get_digest_ctx(const yaca_context_h ctx) } } -static int get_digest_output_length(const yaca_context_h ctx, size_t input_len, size_t *output_len) +static int get_digest_output_length(const yaca_context_h ctx, + UNUSED size_t input_len, + size_t *output_len) { struct yaca_digest_ctx_s *c = get_digest_ctx(ctx); diff --git a/src/internal.h b/src/internal.h index d9cea2e..62aa8fd 100644 --- a/src/internal.h +++ b/src/internal.h @@ -32,6 +32,7 @@ #include #define API __attribute__ ((visibility("default"))) +#define UNUSED __attribute__((unused)) enum yaca_ctx_type_e { YACA_CTX_INVALID = 0, diff --git a/src/key.c b/src/key.c index 8f02b3c..7abd5ff 100644 --- a/src/key.c +++ b/src/key.c @@ -42,7 +42,7 @@ /* This callback only exists to block the default OpenSSL one and * allow us to check for a proper error code when the key is encrypted */ -int password_dummy_cb(char *buf, int size, int rwflag, void *u) +int password_dummy_cb(char *buf, UNUSED int size, UNUSED int rwflag, UNUSED void *u) { const char empty[] = ""; diff --git a/src/sign.c b/src/sign.c index afaaec0..7be2005 100644 --- a/src/sign.c +++ b/src/sign.c @@ -64,7 +64,7 @@ static struct yaca_sign_ctx_s *get_sign_ctx(const yaca_context_h ctx) } static int get_sign_output_length(const yaca_context_h ctx, - size_t input_len, + UNUSED size_t input_len, size_t *output_len) { struct yaca_sign_ctx_s *c = get_sign_ctx(ctx); -- 2.7.4