[llvm-branch-commits] [llvm] 21d7417 - Remove `-Wunused-result` and `-Wpedantic` warnings from GCC. NFC.

Michael Liao via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Dec 2 07:59:14 PST 2020


Author: Michael Liao
Date: 2020-12-02T10:53:59-05:00
New Revision: 21d74172dff79378c5c45ca21b7faa70df64f41a

URL: https://github.com/llvm/llvm-project/commit/21d74172dff79378c5c45ca21b7faa70df64f41a
DIFF: https://github.com/llvm/llvm-project/commit/21d74172dff79378c5c45ca21b7faa70df64f41a.diff

LOG: Remove `-Wunused-result` and `-Wpedantic` warnings from GCC. NFC.

Added: 
    

Modified: 
    llvm/lib/Support/ErrorHandling.cpp
    llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp
index 23b9f962422e..ce6344284f06 100644
--- a/llvm/lib/Support/ErrorHandling.cpp
+++ b/llvm/lib/Support/ErrorHandling.cpp
@@ -170,9 +170,9 @@ void llvm::report_bad_alloc_error(const char *Reason, bool GenCrashDiag) {
   // an OOM to stderr and abort.
   const char *OOMMessage = "LLVM ERROR: out of memory\n";
   const char *Newline = "\n";
-  (void)::write(2, OOMMessage, strlen(OOMMessage));
-  (void)::write(2, Reason, strlen(Reason));
-  (void)::write(2, Newline, strlen(Newline));
+  (void)!::write(2, OOMMessage, strlen(OOMMessage));
+  (void)!::write(2, Reason, strlen(Reason));
+  (void)!::write(2, Newline, strlen(Newline));
   abort();
 #endif
 }

diff  --git a/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp b/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
index 2d86b924e4b0..fbf6c2fe4076 100644
--- a/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
+++ b/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
@@ -77,7 +77,7 @@ static Value *findStoredValue(Value *AllocaValue) {
   if (!Store)
     return nullptr;
   return Store->getValueOperand();
-};
+}
 
 TEST_F(OpenMPIRBuilderTest, CreateBarrier) {
   OpenMPIRBuilder OMPBuilder(*M);


        


More information about the llvm-branch-commits mailing list