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 | 1db5d140b24bd181644135446fdaca75d8396aa4 (patch) | |
tree | fbb7acd04fb81aa6592413d3f6b9a412feaf28d1 /lib/Sema/SemaDeclAttr.cpp | |
parent | 977a58a8fd16bccfbc11b5c4c70b869fded9f8b9 (diff) |
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>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113464 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 25af73ae13..a47d84fa35 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/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]; |