[all-commits] [llvm/llvm-project] 714b4c: [libc][NFC] Fix -Wdangling-else when compiling lib...

Mikhail R. Gadelha via All-commits all-commits at lists.llvm.org
Wed Oct 4 08:44:56 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 714b4c82bb6f5cbeb5617ab68d9240f3194d05f4
      https://github.com/llvm/llvm-project/commit/714b4c82bb6f5cbeb5617ab68d9240f3194d05f4
  Author: Mikhail R. Gadelha <mikhail at igalia.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M libc/test/UnitTest/FPMatcher.h
    M libc/test/UnitTest/LibcTest.h
    M libc/test/src/__support/FPUtil/rounding_mode_test.cpp
    M libc/test/src/spawn/posix_spawn_file_actions_test.cpp
    M libc/utils/MPFRWrapper/MPFRUtils.h

  Log Message:
  -----------
  [libc][NFC] Fix -Wdangling-else when compiling libc with gcc >= 7 (#67833)

Explicit braces were added to fix the "suggest explicit braces to avoid
ambiguous ‘else’" warning since the current solution (switch (0) case 0:
default:) doesn't work since gcc 7 (see
https://github.com/google/googletest/issues/1119)

gcc 13 generates about 5000 of these warnings when building libc without
this patch.




More information about the All-commits mailing list