This is an archive of the discontinued LLVM Phabricator instance.

[WIP] Enable `-Wstrict-calls-without-prototype` by default
Needs RevisionPublic

Authored by delcypher on Jan 4 2022, 5:42 PM.

Details

Summary

This patch enables the -Wstrict-calls-without-prototype warning by
default and fixes the existing clang test suite to pass.

This patch is considered work-in-progress because the patch it is
based on is not finalized. It is also unclear at this point whether this warning should actually
be enabled by default. So this patch serves to illustrate the changes
that would need to be made to have the warning on by default.

rdar://87118271

Diff Detail

Event Timeline

delcypher requested review of this revision.Jan 4 2022, 5:42 PM
delcypher created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 4 2022, 5:42 PM
NoQ added a comment.Jan 5 2022, 10:05 PM

Ooof you fixed a lot of static analyzer tests. If you ever get tired of this, feel free to -w them entirely because the driver's --analyze flag implies -w anyway. Hmm, maybe we should even change %clang_analyze_cc1 to include -w.

aaron.ballman requested changes to this revision.Jan 6 2022, 5:23 AM
aaron.ballman added a subscriber: aaron.ballman.

I don't see a justification for enabling this diagnostic by default in C89 mode. I can imagine users wanting to opt into this behavior for C89, but it certainly shouldn't be diagnosing correct code by default.

This revision now requires changes to proceed.Jan 6 2022, 5:23 AM