diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-09-09 01:17:32 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-09-09 01:17:32 +0000 |
commit | 0f107e4386380e45ea61a16621e149e5d2e1e4c7 (patch) | |
tree | 85a0b0ab28977d6937c8280e66799400803f8a08 /clang/lib/Sema/SemaDeclAttr.cpp | |
parent | 2ff757d4226205703ee24f63cbc6fae8a5f3a391 (diff) | |
download | bcm5719-llvm-0f107e4386380e45ea61a16621e149e5d2e1e4c7.tar.gz bcm5719-llvm-0f107e4386380e45ea61a16621e149e5d2e1e4c7.zip |
Relax __attribute_((nonnull)) checking to allow the attribute on functions with no pointer arguments. GCC doesn't warn
in this case, and the attribute is trivially satisfied (and benign). Fixes <rdar://problem/8364828>.
llvm-svn: 113464
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 25af73ae13d..a47d84fa35c 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -373,10 +373,10 @@ static void HandleNonNullAttr(Decl *d, const AttributeList &Attr, Sema &S) { NonNullArgs.push_back(I); } - if (NonNullArgs.empty()) { - S.Diag(Attr.getLoc(), diag::warn_attribute_nonnull_no_pointers); + // No pointer arguments? The attribute in this case is + // trivially satisfied. + if (NonNullArgs.empty()) return; - } } unsigned* start = &NonNullArgs[0]; |