This is an archive of the discontinued LLVM Phabricator instance.

[clang] Rename missing-declarations to useless-declarations
Needs ReviewPublic

Authored by abrachet on Feb 9 2022, 11:25 AM.

Details

Summary

Clang's missing-declarations is not the same as gcc's. TLDR: clang has missing-prototypes which works similarly to gcc's missing-declarations for C++ and missing-prototypes for C. A future patch will address this.

The warnings that missing-declarations currently control are either not present on gcc, or are always errors. Changing the name of this flag should not impact many people as it was only being used to suppress the default with no-missing-declarations. The warnings it suppresses are at best useless code or at worst incorrect but clang was more permissive than gcc in those areas.

Diff Detail

Event Timeline

abrachet created this revision.Feb 9 2022, 11:25 AM
abrachet requested review of this revision.Feb 9 2022, 11:25 AM
aaron.ballman added a subscriber: cfe-commits.

Thank you for this, but I'd like to get a better understanding of the long-term goals here (and where we diverge from GCC in terms of some code examples). Also, this should probably be mentioned in the release notes somewhere so that people know what to expect about the changes.

(Adding a few more reviewers for visibility since this is touching an existing diagnostic group. Also, subscribing the mailing lists.)