]> granicus.if.org Git - clang/commit
[Sema] add -Walloca to flag uses of `alloca`
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Thu, 25 Jul 2019 22:23:40 +0000 (22:23 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Thu, 25 Jul 2019 22:23:40 +0000 (22:23 +0000)
commitec4812e3ddf5cd7b67bff8eda8d171ca3262c1b7
tree6e3a7daf13d1b0d47c92db080f1ea2a1886e27ae
parent65f56b7e646a1ebc515f225ba4ffefe989e7eaca
[Sema] add -Walloca to flag uses of `alloca`

This CL adds an optional warning to diagnose uses of the
`__builtin_alloca` family of functions. The use of these functions is
discouraged by many, so it seems like a good idea to allow clang to warn
about it.

Patch by Elaina Guan!

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

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