[PATCH] D141310: [clang] add -Wcompare-function-pointers

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 18 11:50:56 PST 2023


dblaikie added a comment.

In D141310#4062776 <https://reviews.llvm.org/D141310#4062776>, @adriandole wrote:

> @dblaikie, we would use this warning in Chrome OS.

Ah, good to know!

> We use `icf=all` and have encountered bugs caused by function pointer comparisons.

& the savings are worth it compared to icf=safe? (given the limitations/bugs/investment in warnings like this, etc) I guess

> It's not that noisy compiling clang (eight hits).

Good to know - I'm surprised it's that low.

Is there some idiom we can use/document/recommend for people to use when the warning is a false positive? (when the user is confident the functions won't be folded together)

> Working on testing it for Chrome OS.

ah, cool - be good to know what that looks like/what kind of changes you end up needing to make to the codebase to get it building cleanly/how much of the work involves fixing real bugs compared to suppressing/satisfying the compiler.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141310/new/

https://reviews.llvm.org/D141310



More information about the cfe-commits mailing list