From 63298ebd6d1bf506bee2368d75f161ab3c30dba8 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Fri, 16 Sep 2022 16:31:34 +0200 Subject: [PATCH] src: silence clang-15 compiler warnings --- CMakeLists.txt | 3 ++- src/filter/cto.h | 1 + src/filter/ctoj.h | 1 + src/filter/ctojr.h | 1 + src/filter/ctok.h | 1 + 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ef78e424..8b0410cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,7 +131,8 @@ if(MSVC) target_compile_options(${t} PRIVATE -DHAVE_STDARG_H -DHAVE_VSNPRINTF -J -W3 ${warn_WX}) else() target_compile_options(${t} PRIVATE -DHAVE_STDARG_H -DHAVE_UNISTD_H -DHAVE_VSNPRINTF) - target_compile_options(${t} PRIVATE -Wall -Wextra -Wvla ${warn_Werror}) + # clang-15: -Wno-strict-prototypes is needed to silence the new -Wdeprecated-non-prototype warning + target_compile_options(${t} PRIVATE -Wall -Wextra -Wvla -Wno-strict-prototypes ${warn_Werror}) endif() set(t upx) diff --git a/src/filter/cto.h b/src/filter/cto.h index 6fb67373..683ac0f6 100644 --- a/src/filter/cto.h +++ b/src/filter/cto.h @@ -129,6 +129,7 @@ static int F(Filter *f) #if 0 || defined(TESTING) printf("\ncalls=%d noncalls=%d noncalls2=%d text_size=%x calltrickoffset=%x\n",calls,noncalls,noncalls2,size,cto); #endif + UNUSED(noncalls2); return 0; } diff --git a/src/filter/ctoj.h b/src/filter/ctoj.h index fb3483ef..83a21b23 100644 --- a/src/filter/ctoj.h +++ b/src/filter/ctoj.h @@ -128,6 +128,7 @@ static int F(Filter *f) #if 0 || defined(TESTING) printf("\ncalls=%d noncalls=%d noncalls2=%d text_size=%x calltrickoffset=%x\n",calls,noncalls,noncalls2,size,cto); #endif + UNUSED(noncalls2); return 0; } diff --git a/src/filter/ctojr.h b/src/filter/ctojr.h index 681e7086..8b46cf70 100644 --- a/src/filter/ctojr.h +++ b/src/filter/ctojr.h @@ -254,6 +254,7 @@ static int F(Filter *f) calls,noncalls,noncalls2,size,cto8); printf("CALL/JMP/JCC %d %d %d\n",wtally[0],wtally[1],wtally[2]); #endif + UNUSED(noncalls2); return 0; } diff --git a/src/filter/ctok.h b/src/filter/ctok.h index 7eea421f..eb2780b7 100644 --- a/src/filter/ctok.h +++ b/src/filter/ctok.h @@ -129,6 +129,7 @@ static int F(Filter *f) #if 0 || defined(TESTING) printf("\ncalls=%d noncalls=%d noncalls2=%d text_size=%x calltrickoffset=%x\n",calls,noncalls,noncalls2,size,cto); #endif + UNUSED(noncalls2); return 0; }