Implement the -Wstrict-prototypes warning
authorAlex Lorenz <arphaman@gmail.com>
Wed, 7 Dec 2016 10:52:18 +0000 (10:52 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Wed, 7 Dec 2016 10:52:18 +0000 (10:52 +0000)
commit840f8df67759b6893b6e58d2eb08124cb5822525
tree2a274e96cee6ac5da2847e68f735307e36e99baa
parent32d5aedd5be8e7f031525af31208d7ea8905945e
Implement the -Wstrict-prototypes warning

This commit fixes PR20796. It implements the C only -Wstrict-prototypes warning.
Clang now emits a warning for function declarations which have no parameters
specified and for K&R function definitions with more than 0 parameters that are
not preceded by a previous prototype declaration.

The patch was originally submitted by Paul Titei!

rdar://15060615

Differential Revision: https://reviews.llvm.org/D16533

llvm-svn: 288896
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaType.cpp
clang/test/Sema/warn-strict-prototypes.c [new file with mode: 0644]
clang/test/Sema/warn-strict-prototypes.m [new file with mode: 0644]