diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index aa383bdb..61296480 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -117,6 +117,15 @@ cmake_minimum_required(VERSION 3.10) project(perf-tools) +if(WIN32) + set(CFLAGS_WARNINGS "/Wall" CACHE STRING "Compiler options for warnings") +else() + set(CFLAGS_WARNINGS "-Wall" CACHE STRING "Compiler options for warnings") +endif() + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CFLAGS_WARNINGS}" + CACHE STRING "C compiler options" FORCE) + find_package(Threads) link_libraries(${CMAKE_THREAD_LIBS_INIT}) diff --git a/source/evp_setpeer.c b/source/evp_setpeer.c index 58fcf6bb..797049d8 100644 --- a/source/evp_setpeer.c +++ b/source/evp_setpeer.c @@ -37,7 +37,6 @@ OSSL_TIME max_time; void do_setpeer(size_t num) { - size_t i; OSSL_TIME time; EVP_PKEY_CTX *pkey_ctx = NULL; @@ -136,7 +135,6 @@ int main(int argc, char *argv[]) OSSL_TIME duration; int terse = 0; int rc = EXIT_FAILURE; - size_t i; int opt; char *key = NULL; @@ -219,8 +217,7 @@ int main(int argc, char *argv[]) pkey = PEM_read_bio_PrivateKey(pem, NULL, NULL, NULL); BIO_free(pem); if (pkey == NULL) { - fprintf(stderr, "Failed to create key: %llu [%s PEM]\n", - (unsigned long long)i, + fprintf(stderr, "Failed to create key: [%s PEM]\n", sample_names[k]); return EXIT_FAILURE; } diff --git a/source/newrawkey.c b/source/newrawkey.c index 176c5bb6..850e5c22 100644 --- a/source/newrawkey.c +++ b/source/newrawkey.c @@ -335,7 +335,6 @@ static int threadcount; void do_newrawkey(size_t num) { - size_t i; EVP_PKEY *pkey; OSSL_TIME time; const unsigned char *key_data = key_x25519; diff --git a/source/randbytes.c b/source/randbytes.c index e923ecd2..7d14fcf6 100644 --- a/source/randbytes.c +++ b/source/randbytes.c @@ -34,7 +34,6 @@ static int threadcount; void do_randbytes(size_t num) { - size_t i; unsigned char buf[32]; OSSL_TIME time;