]> granicus.if.org Git - clang/commit
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)
commit162749f9c543e3175f2df9dc6e48ec74d2b3cb3a
tree043f9eb9543f0740acf478bb54ea0fe92b189c44
parentadfb69666c622cf20c39d9fa4de3ec78170ba6e5
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288896 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDecl.cpp
lib/Sema/SemaType.cpp
test/Sema/warn-strict-prototypes.c [new file with mode: 0644]
test/Sema/warn-strict-prototypes.m [new file with mode: 0644]