Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the strict prototype diagnostic behavior
Post-commit feedback on https://reviews.llvm.org/D122895 pointed out that the diagnostic wording for some code was using "declaration" in a confusing way, such as: int foo(); // warning: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x int foo(int arg) { // warning: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x return 5; } And that we had other minor issues with the diagnostics being somewhat confusing. This patch addresses the confusion by reworking the implementation to be a bit more simple and a bit less chatty. Specifically, it changes the warning and note diagnostics to be able to specify "declaration" or "definition" as appropriate, and it changes the function merging logic so that the function without a prototype is always what gets warned on, and the function with a prototype is sometimes what gets noted. Additionally, when diagnosing a K&R C definition that is preceded by a function without a prototype, we don't note the prior declaration, we warn on it because it will also be changing behavior in C2x. Differential Revision: https://reviews.llvm.org/D125814
- Loading branch information
1 parent
cd5783d
commit 681c50c
Showing
10 changed files
with
78 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.