[PATCH] D19830: [scan-build] fix dead store warnings emitted on clang code base

Apelete Seketeli via cfe-commits cfe-commits at lists.llvm.org
Mon May 2 13:32:12 PDT 2016


apelete created this revision.
apelete added a reviewer: doug.gregor.
apelete added a subscriber: cfe-commits.

This fixes dead store warnings of the type "dead assignment" reported
by CLang Static Analyzer on the following files:

- lib/Lex/Lexer.cpp,
- lib/Lex/ModuleMap.cpp.

Signed-off-by: Apelete Seketeli <apelete at seketeli.net>

http://reviews.llvm.org/D19830

Files:
  lib/Lex/Lexer.cpp
  lib/Lex/ModuleMap.cpp

Index: lib/Lex/ModuleMap.cpp
===================================================================
--- lib/Lex/ModuleMap.cpp
+++ lib/Lex/ModuleMap.cpp
@@ -2197,6 +2197,7 @@
     if (Framework) {
       Diags.Report(StarLoc, diag::err_mmap_inferred_framework_submodule);
       Framework = false;
+      (void) Framework;
     }
   } else if (Explicit) {
     Diags.Report(StarLoc, diag::err_mmap_explicit_inferred_framework);
Index: lib/Lex/Lexer.cpp
===================================================================
--- lib/Lex/Lexer.cpp
+++ lib/Lex/Lexer.cpp
@@ -672,6 +672,7 @@
       // directive or it was one that can't occur in the preamble at this
       // point. Roll back the current token to the location of the '#'.
       InPreprocessorDirective = false;
+      (void) InPreprocessorDirective;
       TheTok = HashTok;
     }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19830.55884.patch
Type: text/x-patch
Size: 842 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160502/d1cb83a0/attachment.bin>


More information about the cfe-commits mailing list