Skip to content

Commit ed379f9

Browse files
firewaveglankk
andcommitted
disabled some compiler warnings
Co-authored-by: glankk <[email protected]>
1 parent 9ed765b commit ed379f9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
3737
add_compile_options(-Woverloaded-virtual) # when a function declaration hides virtual functions from a base class
3838

3939
add_compile_options(-Wsuggest-attribute=noreturn)
40-
add_compile_options_safe(-Wuseless-cast)
40+
#add_compile_options_safe(-Wuseless-cast) # triggered by _WIN32 code
4141
elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
4242
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
4343
# TODO: bump warning level
@@ -51,15 +51,20 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
5151
# these are not really fixable
5252
add_compile_options(-Wno-exit-time-destructors -Wno-global-constructors -Wno-weak-vtables)
5353
add_compile_options_safe(-Wno-unsafe-buffer-usage)
54+
add_compile_options_safe(-Wno-nrvo)
5455
# we are not interested in these
5556
add_compile_options(-Wno-multichar -Wno-four-char-constants)
5657
# ignore C++11-specific warning
5758
add_compile_options(-Wno-suggest-override -Wno-suggest-destructor-override)
5859
# contradicts -Wcovered-switch-default
5960
add_compile_options(-Wno-switch-default)
61+
# for _WIN32
62+
add_compile_options(-Wno-reserved-macro-identifier)
63+
add_compile_options(-Wno-unused-macros)
6064
# TODO: fix these?
6165
add_compile_options(-Wno-padded -Wno-sign-conversion -Wno-implicit-int-conversion -Wno-shorten-64-to-32 -Wno-shadow-field-in-constructor)
6266

67+
6368
if (CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 14 OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 14)
6469
# TODO: verify this regression still exists in clang-15
6570
if (CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")

0 commit comments

Comments
 (0)