meson: Enable initialized-but-unused warning for MSVC
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19792>
This commit is contained in:
@@ -1137,6 +1137,7 @@ if cc.get_argument_syntax() == 'msvc'
|
||||
'/wd5105', # macro expansion producing 'defined' has undefined behavior (winbase.h, need Windows SDK upgrade)
|
||||
'/we4020', # Error when passing the wrong number of parameters
|
||||
'/we4024', # Error when passing different type of parameter
|
||||
'/we4189', # 'identifier' : local variable is initialized but not referenced
|
||||
'/Zc:__cplusplus', #Set __cplusplus macro to match the /std:c++<version> on the command line
|
||||
]
|
||||
c_args += cc.get_supported_arguments(_trial)
|
||||
|
||||
@@ -68,7 +68,7 @@ endif
|
||||
cpp_args_addrlib += cpp.get_supported_arguments(
|
||||
['-Wno-unused-variable', '-Wno-unused-local-typedefs',
|
||||
'-Wno-unused-but-set-variable', '-Wno-maybe-uninitialized',
|
||||
'-Wno-self-assign']
|
||||
'-Wno-self-assign', '/wd4189']
|
||||
)
|
||||
|
||||
libamdgpu_addrlib = static_library(
|
||||
|
||||
+1
-1
@@ -277,7 +277,7 @@ do { \
|
||||
#ifdef HAVE_FUNC_ATTRIBUTE_UNUSED
|
||||
#define UNUSED __attribute__((unused))
|
||||
#elif defined (_MSC_VER)
|
||||
#define UNUSED __pragma(warning(suppress:4100 4101))
|
||||
#define UNUSED __pragma(warning(suppress:4100 4101 4189))
|
||||
#else
|
||||
#define UNUSED
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user