Some versions of gcc still warn about "ignoring return value ... declared
authorDuncan Sands <baldrick@free.fr>
Thu, 16 Sep 2010 08:20:49 +0000 (08:20 +0000)
committerDuncan Sands <baldrick@free.fr>
Thu, 16 Sep 2010 08:20:49 +0000 (08:20 +0000)
with attribute warn_unused_result" here - suppress the warning harder.

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

lib/Support/ErrorHandling.cpp

index 0b7af3e5905be4825ce5ce4f3b11624bab08523b..839c405250b4f7bfbc0d998c603fd65a2461e2cc 100644 (file)
@@ -69,7 +69,8 @@ void llvm::report_fatal_error(const Twine &Reason) {
     raw_svector_ostream OS(Buffer);
     OS << "LLVM ERROR: " << Reason << "\n";
     StringRef MessageStr = OS.str();
-    (void)::write(2, MessageStr.data(), MessageStr.size());
+    ssize_t written = ::write(2, MessageStr.data(), MessageStr.size());
+    (void)written; // If something went wrong, we deliberately just give up.
   }
 
   // If we reached here, we are failing ungracefully. Run the interrupt handlers