diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3bf2ecfb..b78fd510 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -316,8 +316,9 @@ jobs: set s=%H%\src cat .GITREV.txt set /p GITREV=<.GITREV.txt + set UPX_DEFS=-DUPX_CONFIG_DISABLE_WSTRICT=0 -DUPX_CONFIG_DISABLE_WERROR=0 -DWITH_ZSTD=0 set sources=%s%\*.cpp %s%\check\*.cpp %s%\compress\*.cpp %s%\console\*.cpp %s%\filter\*.cpp %s%\util\*.cpp - %RUN_CL% -std:c++17 -Zc:__cplusplus -EHsc -J -O2 -W4 -WX -DUPX_VERSION_GITREV="""%GITREV%""" -DWITH_ZSTD=0 %DEFS% -I%H%\vendor -Feupx.exe %sources% %BDIR%\ucl\ucl.lib %BDIR%\zlib\zlib.lib /link ${{ matrix.link_machine_flags }} setargv.obj + %RUN_CL% -std:c++17 -Zc:__cplusplus -EHsc -J -O2 -W4 -WX -DUPX_VERSION_GITREV="""%GITREV%""" %UPX_DEFS% %DEFS% -I%H%\vendor -Feupx.exe %sources% %BDIR%\ucl\ucl.lib %BDIR%\zlib\zlib.lib /link ${{ matrix.link_machine_flags }} setargv.obj - name: 'Make artifact' shell: bash run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a6f7572..a9f9bc27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -256,11 +256,11 @@ endif() if(Threads_FOUND) target_compile_definitions(${t} PRIVATE WITH_THREADS=1) endif() -if(UPX_CONFIG_DISABLE_WSTRICT) - target_compile_definitions(${t} PRIVATE UPX_CONFIG_DISABLE_WSTRICT=1) +if(NOT UPX_CONFIG_DISABLE_WSTRICT) + target_compile_definitions(${t} PRIVATE UPX_CONFIG_DISABLE_WSTRICT=0) endif() -if(UPX_CONFIG_DISABLE_WERROR) - target_compile_definitions(${t} PRIVATE UPX_CONFIG_DISABLE_WERROR=1) +if(NOT UPX_CONFIG_DISABLE_WERROR) + target_compile_definitions(${t} PRIVATE UPX_CONFIG_DISABLE_WERROR=0) endif() if(NOT UPX_CONFIG_DISABLE_ZSTD) target_compile_definitions(${t} PRIVATE WITH_ZSTD=1) diff --git a/src/conf.h b/src/conf.h index b6457e4a..b4360508 100644 --- a/src/conf.h +++ b/src/conf.h @@ -48,7 +48,8 @@ ACC_COMPILE_TIME_ASSERT_HEADER(CHAR_MAX == 255) // -funsigned-char ACC_COMPILE_TIME_ASSERT_HEADER((char)(-1) == 255) // -funsigned-char // enable some more strict warnings for Git developer builds -#if !UPX_CONFIG_DISABLE_WSTRICT && !UPX_CONFIG_DISABLE_WERROR +#if defined(UPX_CONFIG_DISABLE_WSTRICT) && (UPX_CONFIG_DISABLE_WSTRICT + 0 == 0) +#if defined(UPX_CONFIG_DISABLE_WERROR) && (UPX_CONFIG_DISABLE_WERROR + 0 == 0) #if (ACC_CC_CLANG >= 0x0b0000) # pragma clang diagnostic error "-Wsuggest-override" #elif (ACC_CC_GNUC >= 0x0a0000) @@ -70,7 +71,8 @@ ACC_COMPILE_TIME_ASSERT_HEADER((char)(-1) == 255) // -funsigned-char # pragma warning(error: 4319) # pragma warning(error: 4805) #endif -#endif // !UPX_CONFIG_DISABLE_WSTRICT && !UPX_CONFIG_DISABLE_WERROR +#endif // UPX_CONFIG_DISABLE_WSTRICT +#endif // UPX_CONFIG_DISABLE_WERROR // multithreading (UPX currently does not use multithreading) #if (WITH_THREADS)