[cfe-commits] r86662 - /cfe/trunk/lib/Analysis/CheckSizeofPointer.cpp

Zhongxing Xu xuzhongxing at gmail.com
Mon Nov 9 20:20:21 PST 2009


Author: zhongxingxu
Date: Mon Nov  9 22:20:20 2009
New Revision: 86662

URL: http://llvm.org/viewvc/llvm-project?rev=86662&view=rev
Log:
SizeofPointerChecker: If an explicit type specifier is used, do not issue warnings.

Modified:
    cfe/trunk/lib/Analysis/CheckSizeofPointer.cpp

Modified: cfe/trunk/lib/Analysis/CheckSizeofPointer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CheckSizeofPointer.cpp?rev=86662&r1=86661&r2=86662&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/CheckSizeofPointer.cpp (original)
+++ cfe/trunk/lib/Analysis/CheckSizeofPointer.cpp Mon Nov  9 22:20:20 2009
@@ -42,6 +42,11 @@
   if (!E->isSizeOf())
     return;
 
+  // If an explicit type is used in the code, usually the coder knows what he is
+  // doing.
+  if (E->isArgumentType())
+    return;
+
   QualType T = E->getTypeOfArgument();
   if (T->isPointerType()) {
     SourceRange R = E->getSourceRange();





More information about the cfe-commits mailing list