[compiler-rt] r229392 - tsan: fix compiler warning

Dmitry Vyukov dvyukov at google.com
Mon Feb 16 05:53:01 PST 2015


Author: dvyukov
Date: Mon Feb 16 07:53:00 2015
New Revision: 229392

URL: http://llvm.org/viewvc/llvm-project?rev=229392&view=rev
Log:
tsan: fix compiler warning

mingw gcc complains:
warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized]
       Printf("Failed to read options from '%s': error %d\n", value, err);


Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_flags.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_flags.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_flags.cc?rev=229392&r1=229391&r2=229392&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_flags.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_flags.cc Mon Feb 16 07:53:00 2015
@@ -54,7 +54,7 @@ class FlagHandlerInclude : public FlagHa
   bool Parse(const char *value) final {
     char *data;
     uptr data_mapped_size;
-    int err;
+    int err = 0;
     uptr len =
       ReadFileToBuffer(value, &data, &data_mapped_size,
                        Max(kMaxIncludeSize, GetPageSizeCached()), &err);





More information about the llvm-commits mailing list