Skip to content

Commit 5765855

Browse files
committed
Silence noisy (and useless) MSVC warnings
1 parent d6b4c7d commit 5765855

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,21 @@ if(MSVC)
5252
xcheck_add_c_compiler_flag(-Wno-reserved-identifier)
5353
xcheck_add_c_compiler_flag(-Wdeprecated-declarations)
5454
xcheck_add_c_compiler_flag(/experimental:c11atomics)
55+
xcheck_add_c_compiler_flag(/wd4018) # -Wno-sign-conversion
56+
xcheck_add_c_compiler_flag(/wd4061) # -Wno-implicit-fallthrough
57+
xcheck_add_c_compiler_flag(/wd4100) # -Wno-unused-parameter
58+
xcheck_add_c_compiler_flag(/wd4200) # -Wno-zero-length-array
59+
xcheck_add_c_compiler_flag(/wd4242) # -Wno-shorten-64-to-32
60+
xcheck_add_c_compiler_flag(/wd4244) # -Wno-shorten-64-to-32
61+
xcheck_add_c_compiler_flag(/wd4245) # -Wno-sign-compare
62+
xcheck_add_c_compiler_flag(/wd4267) # -Wno-shorten-64-to-32
63+
xcheck_add_c_compiler_flag(/wd4388) # -Wno-sign-compare
64+
xcheck_add_c_compiler_flag(/wd4389) # -Wno-sign-compare
65+
xcheck_add_c_compiler_flag(/wd4710) # Function not inlined
66+
xcheck_add_c_compiler_flag(/wd4711) # Function was inlined
67+
xcheck_add_c_compiler_flag(/wd4820) # Padding added after construct
68+
xcheck_add_c_compiler_flag(/wd4996) # -Wdeprecated-declarations
69+
xcheck_add_c_compiler_flag(/wd5045) # Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
5570
endif()
5671

5772
# MacOS and GCC 11 or later need -Wno-maybe-uninitialized

cutils.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737
#undef NANOSEC
3838
#define NANOSEC ((uint64_t) 1e9)
3939

40+
#ifdef __GNUC__
4041
#pragma GCC visibility push(default)
42+
#endif
4143

4244
void pstrcpy(char *buf, int buf_size, const char *str)
4345
{
@@ -1404,4 +1406,6 @@ int js_cond_timedwait(js_cond_t *cond, js_mutex_t *mutex, uint64_t timeout) {
14041406

14051407
#endif /* !defined(EMSCRIPTEN) && !defined(__wasi__) */
14061408

1409+
#ifdef __GNUC__
14071410
#pragma GCC visibility pop
1411+
#endif

quickjs.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@
6767
#define CONFIG_ATOMICS
6868
#endif
6969

70+
#ifndef __GNUC__
71+
#define __extension__
72+
#endif
73+
7074
// Debug trace system: the debug output will be produced to the dump stream (currently
7175
// stdout) if qjs is invoked with -D<bitmask> with the corresponding bit set.
7276

0 commit comments

Comments
 (0)