summaryrefslogtreecommitdiffstats
path: root/lib/Support
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2017-07-19 15:45:34 +0000
committerHans Wennborg <hans@hanshq.net>2017-07-19 15:45:34 +0000
commit7a74a42df323a9fdf79c5121e82ed724e2e667dc (patch)
tree8e21af090872038ac5c43f3a3f70266b69ed18aa /lib/Support
parentd7a44b94a776012592026335c427465d81df45c7 (diff)
Merging r308483:
------------------------------------------------------------------------ r308483 | hans | 2017-07-19 08:03:38 -0700 (Wed, 19 Jul 2017) | 12 lines Defeat a GCC -Wunused-result warning It was warning like: ../llvm-project/llvm/lib/Support/ErrorHandling.cpp:172:51: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result] (void)::write(2, OOMMessage, strlen(OOMMessage)); Work around the warning by storing the return value in a variable and casting that to void instead. We already did this for the other write() call in this file. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_50@308487 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/ErrorHandling.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Support/ErrorHandling.cpp b/lib/Support/ErrorHandling.cpp
index 2fd4f3ea0d45..fb8ae4c1cd5e 100644
--- a/lib/Support/ErrorHandling.cpp
+++ b/lib/Support/ErrorHandling.cpp
@@ -169,7 +169,8 @@ void llvm::report_bad_alloc_error(const char *Reason, bool GenCrashDiag) {
// Don't call the normal error handler. It may allocate memory. Directly write
// an OOM to stderr and abort.
char OOMMessage[] = "LLVM ERROR: out of memory\n";
- (void)::write(2, OOMMessage, strlen(OOMMessage));
+ ssize_t written = ::write(2, OOMMessage, strlen(OOMMessage));
+ (void)written;
abort();
#endif
}