[all-commits] [llvm/llvm-project] d0e4af: Silence -Wcast-function-type warnings on idiomatic...

Aaron Ballman via All-commits all-commits at lists.llvm.org
Tue Apr 15 08:19:41 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d0e4af8a88dc7a0377677000d0c92104ff215347
      https://github.com/llvm/llvm-project/commit/d0e4af8a88dc7a0377677000d0c92104ff215347
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2025-04-15 (Tue, 15 Apr 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaCast.cpp
    A clang/test/Sema/warn-cast-function-type-win.c

  Log Message:
  -----------
  Silence -Wcast-function-type warnings on idiomatic Windows code (#135660)

On Windows, GetProcAddress() is the API used to dynamically load
function pointers (similar to dlsym on Linux). This API returns a
function pointer (a typedef named FARPROC), which means that casting
from the call to the eventual correct type is technically a function
type mismatch on the cast. However, because this is idiomatic code on
Windows, we should accept it unless -Wcast-function-type-strict is
passed.

This was brought up in post-commit review feedback on
https://github.com/llvm/llvm-project/pull/86131



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