]> granicus.if.org Git - clang/commitdiff
Fix MSVC unused variable warning.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 25 Oct 2016 12:59:15 +0000 (12:59 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 25 Oct 2016 12:59:15 +0000 (12:59 +0000)
LLVM_ATTRIBUTE_UNUSED doesn't work for non-gcc style compilers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285067 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp

index 2aa222ad248499932fba86b295a289b49a34539e..5d7a14d3be14a171f45f76345c4ad7e672cefa86 100644 (file)
@@ -464,10 +464,11 @@ void StdLibraryFunctionsChecker::initFunctionSummaries(
   QualType SSizeTy = ACtx.getIntTypeForBitwidth(ACtx.getTypeSize(SizeTy), true);
 
   // Don't worry about truncation here, it'd be cast back to SIZE_MAX when used.
-  LLVM_ATTRIBUTE_UNUSED int64_t SizeMax =
+  int64_t SizeMax =
       BVF.getMaxValue(SizeTy).getLimitedValue();
   int64_t SSizeMax =
     BVF.getMaxValue(SSizeTy).getLimitedValue();
+  (void)SizeMax;
 
   // We are finally ready to define specifications for all supported functions.
   //