Silence noisy (and useless) MSVC warnings

This commit is contained in:
Saúl Ibarra Corretgé 2024-09-10 09:18:51 +02:00
parent d6b4c7d24f
commit 5765855089
3 changed files with 23 additions and 0 deletions

View file

@ -52,6 +52,21 @@ if(MSVC)
xcheck_add_c_compiler_flag(-Wno-reserved-identifier) xcheck_add_c_compiler_flag(-Wno-reserved-identifier)
xcheck_add_c_compiler_flag(-Wdeprecated-declarations) xcheck_add_c_compiler_flag(-Wdeprecated-declarations)
xcheck_add_c_compiler_flag(/experimental:c11atomics) 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(/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() endif()
# MacOS and GCC 11 or later need -Wno-maybe-uninitialized # MacOS and GCC 11 or later need -Wno-maybe-uninitialized

View file

@ -37,7 +37,9 @@
#undef NANOSEC #undef NANOSEC
#define NANOSEC ((uint64_t) 1e9) #define NANOSEC ((uint64_t) 1e9)
#ifdef __GNUC__
#pragma GCC visibility push(default) #pragma GCC visibility push(default)
#endif
void pstrcpy(char *buf, int buf_size, const char *str) void pstrcpy(char *buf, int buf_size, const char *str)
{ {
@ -1404,4 +1406,6 @@ int js_cond_timedwait(js_cond_t *cond, js_mutex_t *mutex, uint64_t timeout) {
#endif /* !defined(EMSCRIPTEN) && !defined(__wasi__) */ #endif /* !defined(EMSCRIPTEN) && !defined(__wasi__) */
#ifdef __GNUC__
#pragma GCC visibility pop #pragma GCC visibility pop
#endif

View file

@ -67,6 +67,10 @@
#define CONFIG_ATOMICS #define CONFIG_ATOMICS
#endif #endif
#ifndef __GNUC__
#define __extension__
#endif
// Debug trace system: the debug output will be produced to the dump stream (currently // Debug trace system: the debug output will be produced to the dump stream (currently
// stdout) if qjs is invoked with -D<bitmask> with the corresponding bit set. // stdout) if qjs is invoked with -D<bitmask> with the corresponding bit set.