[llvm] 08e5938 - Fix uninitialized variable warning. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 2 11:27:52 PDT 2019


Author: Simon Pilgrim
Date: 2019-11-02T18:03:21Z
New Revision: 08e593895d51653bcd8659a14fafed381659f406

URL: https://github.com/llvm/llvm-project/commit/08e593895d51653bcd8659a14fafed381659f406
DIFF: https://github.com/llvm/llvm-project/commit/08e593895d51653bcd8659a14fafed381659f406.diff

LOG: Fix uninitialized variable warning. NFCI.

Added: 
    

Modified: 
    llvm/tools/llvm-ar/llvm-ar.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp
index c9cf217f7688..c70b8814b285 100644
--- a/llvm/tools/llvm-ar/llvm-ar.cpp
+++ b/llvm/tools/llvm-ar/llvm-ar.cpp
@@ -1092,7 +1092,7 @@ static int ar_main(int argc, char **argv) {
   cl::ExpandResponseFiles(Saver, cl::TokenizeGNUCommandLine, Argv);
   for (size_t i = 1; i < Argv.size(); ++i) {
     StringRef Arg = Argv[i];
-    const char *match;
+    const char *match = nullptr;
     auto MatchFlagWithArg = [&](const char *expected) {
       size_t len = strlen(expected);
       if (Arg == expected) {


        


More information about the llvm-commits mailing list