This is an archive of the discontinued LLVM Phabricator instance.

Add warning flag -Wordered-compare-function-pointers.
ClosedPublic

Authored by efriedma on Apr 26 2018, 5:02 PM.

Details

Summary

The C standard doesn't allow comparisons like "f1 < f2" (where f1 and f2 are function pointers), but we allow them as an extension. Add a warning flag to control this warning.

(Not sure I like the name, but this seems to describe the warning reasonably well. Suggestions welcome.)

Diff Detail

Repository
rC Clang

Event Timeline

efriedma created this revision.Apr 26 2018, 5:02 PM
rsmith accepted this revision.Apr 27 2018, 4:09 PM
This revision is now accepted and ready to land.Apr 27 2018, 4:09 PM
This revision was automatically updated to reflect the committed changes.

Ideally there should be a test that verifies that -Wordered-compare-function-pointers / -Wno-ordered-compare-function-pointers / the default is what you expect it to be.