]> granicus.if.org Git - clang/commit
Skip both character pointers and void pointers when diagnosing bad
authorChandler Carruth <chandlerc@gmail.com>
Thu, 16 Jun 2011 02:00:04 +0000 (02:00 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Thu, 16 Jun 2011 02:00:04 +0000 (02:00 +0000)
commit5546e69729b9f195afd0410948e013206618b717
tree9cff50aed75fb580ba4714d294662ae58ed892bf
parent62c37119940e76b8b8923d99551a779e686f9d2f
Skip both character pointers and void pointers when diagnosing bad
argument types for mem{set,cpy,move}. Character pointers, much like void
pointers, often point to generic "memory", so trying to check whether
they match the type of the argument to 'sizeof' (or other checks) is
unproductive and often results in false positives.

Nico, please review; does this miss any of the bugs you were trying to
find with this warning? The array test case you had should be caught by
the array-specific sizeof warning I think.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133136 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaChecking.cpp
test/SemaCXX/warn-memset-bad-sizeof.cpp