diff --git a/CMakeLists.txt b/CMakeLists.txt index 91c6c683e..11a8e943c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,23 +64,6 @@ if(MSVC) xcheck_add_c_compiler_flag(-Wno-reserved-identifier) xcheck_add_c_compiler_flag(-Wdeprecated-declarations) xcheck_add_c_compiler_flag(/experimental:c11atomics) - xcheck_add_c_compiler_flag(/wd4018) # -Wno-sign-conversion - xcheck_add_c_compiler_flag(/wd4061) # -Wno-implicit-fallthrough - xcheck_add_c_compiler_flag(/wd4100) # -Wno-unused-parameter - xcheck_add_c_compiler_flag(/wd4200) # -Wno-zero-length-array - xcheck_add_c_compiler_flag(/wd4242) # -Wno-shorten-64-to-32 - xcheck_add_c_compiler_flag(/wd4244) # -Wno-shorten-64-to-32 - xcheck_add_c_compiler_flag(/wd4245) # -Wno-sign-compare - xcheck_add_c_compiler_flag(/wd4267) # -Wno-shorten-64-to-32 - xcheck_add_c_compiler_flag(/wd4388) # -Wno-sign-compare - xcheck_add_c_compiler_flag(/wd4389) # -Wno-sign-compare - xcheck_add_c_compiler_flag(/wd4456) # Hides previous local declaration - xcheck_add_c_compiler_flag(/wd4457) # Hides function parameter - xcheck_add_c_compiler_flag(/wd4710) # Function not inlined - xcheck_add_c_compiler_flag(/wd4711) # Function was inlined - xcheck_add_c_compiler_flag(/wd4820) # Padding added after construct - xcheck_add_c_compiler_flag(/wd4996) # -Wdeprecated-declarations - xcheck_add_c_compiler_flag(/wd5045) # Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified endif() # Set a 8MB default stack size on Windows. diff --git a/quickjs.c b/quickjs.c index 8b9a3b573..3b5b2e1c4 100644 --- a/quickjs.c +++ b/quickjs.c @@ -43,6 +43,26 @@ #include #include +#ifdef _MSC_VER +#pragma warning(disable: 4018) // -Wno-sign-conversion +#pragma warning(disable: 4061) // -Wno-implicit-fallthrough +#pragma warning(disable: 4100) // -Wno-unused-parameter +#pragma warning(disable: 4200) // -Wno-zero-length-array +#pragma warning(disable: 4242) // -Wno-shorten-64-to-32 +#pragma warning(disable: 4244) // -Wno-shorten-64-to-32 +#pragma warning(disable: 4245) // -Wno-sign-compare +#pragma warning(disable: 4267) // -Wno-shorten-64-to-32 +#pragma warning(disable: 4388) // -Wno-sign-compare +#pragma warning(disable: 4389) // -Wno-sign-compare +#pragma warning(disable: 4456) // Hides previous local declaration +#pragma warning(disable: 4457) // Hides function parameter +#pragma warning(disable: 4710) // Function not inlined +#pragma warning(disable: 4711) // Function was inlined +#pragma warning(disable: 4820) // Padding added after construct +#pragma warning(disable: 4996) // -Wdeprecated-declarations +#pragma warning(disable: 5045) // Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified +#endif + #include "cutils.h" #include "list.h" #include "quickjs.h"