[all-commits] [llvm/llvm-project] 2bc098: [clang][Sema] Don't issue -Wcast-function-type-mis...

Raul Tambre via All-commits all-commits at lists.llvm.org
Mon Jun 3 10:57:22 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2bc098b8aba089fe8328b3b8a8b6b6816cd5a908
      https://github.com/llvm/llvm-project/commit/2bc098b8aba089fe8328b3b8a8b6b6816cd5a908
  Author: Raul Tambre <raul at tambre.ee>
  Date:   2024-06-03 (Mon, 03 Jun 2024)

  Changed paths:
    M clang/lib/Sema/SemaCast.cpp
    M clang/test/Sema/warn-cast-function-type-strict.c
    M clang/test/Sema/warn-cast-function-type.c
    M clang/test/SemaCXX/warn-cast-function-type-strict.cpp
    M clang/test/SemaCXX/warn-cast-function-type.cpp

  Log Message:
  -----------
  [clang][Sema] Don't issue -Wcast-function-type-mismatch for enums with a matching underlying type (#87793)

Enums are passed as their underlying integral type so they're ABI compatible if the size matches.
Useful with C APIs that pass user-controlled values to callbacks that can be made type safe by using enumerations (e.g. GStreamer).

Discovered internally in some code after 999d4f840777bf8de26d45947192aa0728edc0fb.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list