Skip to content

Commit a8b8456

Browse files
authored
Fix warnings when upgraded to clang 22 (#709)
1 parent 0405ccf commit a8b8456

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

CMakeLists.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ if(MSVC)
600600
if(NO_WCHAR_T)
601601
message(STATUS "Using non-native wchar_t as unsigned short")
602602
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
603-
target_compile_options(${t} PRIVATE "/Zc:wchar_t-")
603+
target_compile_options(${t} PRIVATE /Zc:wchar_t-)
604604
endforeach()
605605
endif()
606606
endif()
@@ -615,27 +615,30 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|IntelLLVM")
615615
set(WarningsLib -Wall -Wpedantic -Wextra)
616616

617617
if((BUILD_XBOX_EXTS_XBOXONE OR BUILD_XBOX_EXTS_SCARLETT) AND WIN32)
618-
list(APPEND WarningsLib "-Wno-microsoft-enum-value" "-Wno-non-virtual-dtor" "-Wno-ignored-pragmas" "-Wno-deprecated-dynamic-exception-spec")
618+
list(APPEND WarningsLib -Wno-microsoft-enum-value -Wno-non-virtual-dtor -Wno-ignored-pragmas -Wno-deprecated-dynamic-exception-spec)
619619
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0)
620-
list(APPEND WarningsLib "-Wno-reserved-identifier")
620+
list(APPEND WarningsLib -Wno-reserved-identifier)
621621
endif()
622622
endif()
623623

624624
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0)
625-
list(APPEND WarningsLib "-Wno-unsafe-buffer-usage")
625+
list(APPEND WarningsLib -Wno-unsafe-buffer-usage)
626626
endif()
627627
target_compile_options(${PROJECT_NAME} PRIVATE ${WarningsLib})
628628

629-
set(WarningsEXE ${WarningsLib} "-Wno-c++98-compat" "-Wno-c++98-compat-pedantic" "-Wno-switch" "-Wno-switch-enum" "-Wno-switch-default" "-Wno-covered-switch-default" "-Wno-language-extension-token" "-Wno-missing-prototypes" "-Wno-global-constructors" "-Wno-double-promotion")
629+
set(WarningsEXE ${WarningsLib}
630+
-Wno-c++98-compat -Wno-c++98-compat-pedantic
631+
-Wno-switch -Wno-switch-enum -Wno-switch-default -Wno-covered-switch-default -Wno-language-extension-token
632+
-Wno-missing-prototypes -Wno-global-constructors -Wno-double-promotion -Wno-padded)
630633
foreach(t IN LISTS TOOL_EXES)
631634
target_compile_options(${t} PRIVATE ${WarningsEXE})
632635
endforeach()
633636
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
634637
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
635-
target_compile_options(${t} PRIVATE "-Wno-ignored-attributes" "-Walloc-size-larger-than=4GB")
638+
target_compile_options(${t} PRIVATE -Wno-ignored-attributes -Walloc-size-larger-than=4GB)
636639

637640
if(BUILD_SHARED_LIBS)
638-
target_compile_options(${t} PRIVATE "-Wno-attributes")
641+
target_compile_options(${t} PRIVATE -Wno-attributes)
639642
endif()
640643
endforeach()
641644
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")

DirectXTex/DirectXTexP.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
#pragma clang diagnostic ignored "-Wlanguage-extension-token"
7777
#pragma clang diagnostic ignored "-Wmissing-variable-declarations"
7878
#pragma clang diagnostic ignored "-Wnested-anon-types"
79+
#pragma clang diagnostic ignored "-Wpadded"
7980
#pragma clang diagnostic ignored "-Wreserved-id-macro"
8081
#pragma clang diagnostic ignored "-Wswitch-enum"
8182
#pragma clang diagnostic ignored "-Wtautological-type-limit-compare"

0 commit comments

Comments
 (0)