Skip to content

Commit 4afbe3a

Browse files
am11jkotas
authored andcommitted
Delete null comparisons of non-null arguments (dotnet#27523)
Remove gcc nonnull-compare suppression and impossible conditions. > error: nonnull argument 'this' compared to NULL > [-Werror=nonnull-compare]
1 parent 564dcc0 commit 4afbe3a

29 files changed

+3144
-3190
lines changed

configurecompiler.cmake

+2-5
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ if (MSVC)
256256
add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:/SUBSYSTEM:WINDOWS,${WINDOWS_SUBSYSTEM_VERSION}>)
257257

258258
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /IGNORE:4221")
259-
259+
260260
add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:/DEBUG>)
261261
add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:/PDBCOMPRESS>)
262262
add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:/STACK:1572864>)
@@ -312,7 +312,7 @@ elseif (CLR_CMAKE_PLATFORM_UNIX)
312312
endif ()
313313
if (${__UBSAN_POS} GREATER -1)
314314
# all sanitizier flags are enabled except alignment (due to heavy use of __unaligned modifier)
315-
list(APPEND CLR_CXX_SANITIZERS
315+
list(APPEND CLR_CXX_SANITIZERS
316316
"bool"
317317
bounds
318318
enum
@@ -513,9 +513,6 @@ if (CLR_CMAKE_PLATFORM_UNIX)
513513
else()
514514
add_compile_options(-Wno-unused-but-set-variable)
515515
add_compile_options(-Wno-unknown-pragmas)
516-
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
517-
add_compile_options(-Wno-nonnull-compare)
518-
endif()
519516
if (COMPILER_SUPPORTS_F_ALIGNED_NEW)
520517
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-faligned-new>)
521518
endif()

src/ToolBox/superpmi/superpmi-shared/lightweightmap.h

-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,6 @@ class LightWeightMap : public LightWeightMapBuffer
373373

374374
int GetIndex(_Key key)
375375
{
376-
AssertCodeMsg(this != nullptr, EXCEPTIONCODE_MC, "There is no such LWM (in GetIndex)");
377376
if (numItems == 0)
378377
return -1;
379378

0 commit comments

Comments
 (0)