[compiler-rt] r229562 - Silence an MSVC warning about testing a function for truth without calling it

Reid Kleckner reid at kleckner.net
Tue Feb 17 13:57:42 PST 2015


Author: rnk
Date: Tue Feb 17 15:57:42 2015
New Revision: 229562

URL: http://llvm.org/viewvc/llvm-project?rev=229562&view=rev
Log:
Silence an MSVC warning about testing a function for truth without calling it

In general, this is a reasonable warning, except real_pthread_create is
weak and can be null.  The existing usage is correct as it the function
is declared with SANITIZER_WEAK, but MSVC can't know that because it is
defined to nothing on Windows.

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

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_libcdep.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_libcdep.cc?rev=229562&r1=229561&r2=229562&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_libcdep.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_libcdep.cc Tue Feb 17 15:57:42 2015
@@ -121,7 +121,7 @@ void MaybeStartBackgroudThread() {
   // Start the background thread if one of the rss limits is given.
   if (!common_flags()->hard_rss_limit_mb &&
       !common_flags()->soft_rss_limit_mb) return;
-  if (!real_pthread_create) return;  // Can't spawn the thread anyway.
+  if (!&real_pthread_create) return;  // Can't spawn the thread anyway.
   internal_start_thread(BackgroundThread, nullptr);
 }
 





More information about the llvm-commits mailing list