fzakaria updated this revision to Diff 543244. fzakaria added a comment. The previous CMake variable wasn't working.
Changed it to the pattern I see in the codebase. Confirmed it via `ninja` command and grepping. ❯ rg --color=always no-nonnull build.ninja | head -n 1 FLAGS = -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O2 -g -DNDEBUG -fno-exceptions -funwind-tables -fno-rtti -gsplit-dwarf -std=c++17 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155857/new/ https://reviews.llvm.org/D155857 Files: llvm/cmake/modules/HandleLLVMOptions.cmake Index: llvm/cmake/modules/HandleLLVMOptions.cmake =================================================================== --- llvm/cmake/modules/HandleLLVMOptions.cmake +++ llvm/cmake/modules/HandleLLVMOptions.cmake @@ -770,6 +770,11 @@ append_if(USE_NO_UNINITIALIZED "-Wno-uninitialized" CMAKE_CXX_FLAGS) append_if(USE_NO_MAYBE_UNINITIALIZED "-Wno-maybe-uninitialized" CMAKE_CXX_FLAGS) + # Disable -Wnonnull forthis GCC warning as it is emitting a lot of false positives. + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + append("-Wno-nonnull" CMAKE_CXX_FLAGS) + endif() + # Disable -Wclass-memaccess, a C++-only warning from GCC 8 that fires on # LLVM's ADT classes. check_cxx_compiler_flag("-Wclass-memaccess" CXX_SUPPORTS_CLASS_MEMACCESS_FLAG)
Index: llvm/cmake/modules/HandleLLVMOptions.cmake =================================================================== --- llvm/cmake/modules/HandleLLVMOptions.cmake +++ llvm/cmake/modules/HandleLLVMOptions.cmake @@ -770,6 +770,11 @@ append_if(USE_NO_UNINITIALIZED "-Wno-uninitialized" CMAKE_CXX_FLAGS) append_if(USE_NO_MAYBE_UNINITIALIZED "-Wno-maybe-uninitialized" CMAKE_CXX_FLAGS) + # Disable -Wnonnull forthis GCC warning as it is emitting a lot of false positives. + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + append("-Wno-nonnull" CMAKE_CXX_FLAGS) + endif() + # Disable -Wclass-memaccess, a C++-only warning from GCC 8 that fires on # LLVM's ADT classes. check_cxx_compiler_flag("-Wclass-memaccess" CXX_SUPPORTS_CLASS_MEMACCESS_FLAG)
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits