[llvm] 6b46166 - [llvm][NFC] Suppress `-Wunused-result` call to `write`
Jordan Rupprecht via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 10 19:14:13 PDT 2024
Author: Jordan Rupprecht
Date: 2024-04-11T02:14:07Z
New Revision: 6b46166ef2612d2a58767447b3db8f0343afb552
URL: https://github.com/llvm/llvm-project/commit/6b46166ef2612d2a58767447b3db8f0343afb552
DIFF: https://github.com/llvm/llvm-project/commit/6b46166ef2612d2a58767447b3db8f0343afb552.diff
LOG: [llvm][NFC] Suppress `-Wunused-result` call to `write`
Commit 87e6f87fe7e343eb656e9b49d30cbb065c086651 adds a call to `::write()`, which may be annotated w/ `warn_unused_result`, leading to `-Wunused-result` failures.
Added:
Modified:
llvm/lib/Support/raw_socket_stream.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Support/raw_socket_stream.cpp b/llvm/lib/Support/raw_socket_stream.cpp
index 1dcf6352f2cc23..14e2308df4d7ed 100644
--- a/llvm/lib/Support/raw_socket_stream.cpp
+++ b/llvm/lib/Support/raw_socket_stream.cpp
@@ -265,7 +265,10 @@ void ListeningSocket::shutdown() {
// Ensure ::poll returns if shutdown is called by a seperate thread
char Byte = 'A';
- ::write(PipeFD[1], &Byte, 1);
+ ssize_t written = ::write(PipeFD[1], &Byte, 1);
+
+ // Ignore any write() error
+ (void)written;
}
ListeningSocket::~ListeningSocket() {
More information about the llvm-commits
mailing list