Skip to content

[lldb-dap] Silence Wunused-result warning #126580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

keith
Copy link
Member

@keith keith commented Feb 10, 2025

No description provided.

@keith keith requested a review from JDevlieghere as a code owner February 10, 2025 19:07
@keith keith requested a review from ashgti February 10, 2025 19:07
@keith
Copy link
Member Author

keith commented Feb 10, 2025

showed up since adb9ef0

@keith
Copy link
Member Author

keith commented Feb 10, 2025

lldb/tools/lldb-dap/OutputRedirector.cpp:89:5: error: ignoring return value of function declared with 'warn_unused_result' attribute [-Werror,-Wunused-result]
   89 |     ::write(fd, buf, sizeof(buf));
      |     ^~~~~~~ ~~~~~~~~~~~~~~~~~~~~
1 error generated.

@llvmbot
Copy link
Member

llvmbot commented Feb 10, 2025

@llvm/pr-subscribers-lldb

Author: Keith Smiley (keith)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/126580.diff

1 Files Affected:

  • (modified) lldb/tools/lldb-dap/OutputRedirector.cpp (+1-1)
diff --git a/lldb/tools/lldb-dap/OutputRedirector.cpp b/lldb/tools/lldb-dap/OutputRedirector.cpp
index 7935e17a653bec3..a23572ab7ae0425 100644
--- a/lldb/tools/lldb-dap/OutputRedirector.cpp
+++ b/lldb/tools/lldb-dap/OutputRedirector.cpp
@@ -86,7 +86,7 @@ void OutputRedirector::Stop() {
     // write descriptor is duplicated (to stdout/err or to another process).
     // Write a null byte to ensure the read call returns.
     char buf[] = "\0";
-    ::write(fd, buf, sizeof(buf));
+    (void)::write(fd, buf, sizeof(buf));
     ::close(fd);
     m_forwarder.join();
   }

@keith keith merged commit 1932ed0 into llvm:main Feb 10, 2025
10 checks passed
@keith keith deleted the ks/lldb-dap-silence-wunused-result-warning branch February 10, 2025 23:20
Icohedron pushed a commit to Icohedron/llvm-project that referenced this pull request Feb 11, 2025
joaosaffran pushed a commit to joaosaffran/llvm-project that referenced this pull request Feb 14, 2025
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Feb 24, 2025
JDevlieghere pushed a commit to swiftlang/llvm-project that referenced this pull request Feb 25, 2025
SquallATF pushed a commit to SquallATF/llvm-project that referenced this pull request Mar 8, 2025
SquallATF pushed a commit to SquallATF/llvm-project that referenced this pull request Mar 20, 2025
SquallATF pushed a commit to SquallATF/llvm-project that referenced this pull request Apr 2, 2025
SquallATF pushed a commit to SquallATF/llvm-project that referenced this pull request Apr 17, 2025
SquallATF pushed a commit to SquallATF/llvm-project that referenced this pull request Apr 30, 2025
SquallATF pushed a commit to SquallATF/llvm-project that referenced this pull request May 15, 2025
SquallATF pushed a commit to SquallATF/llvm-project that referenced this pull request May 29, 2025
SquallATF pushed a commit to SquallATF/llvm-project that referenced this pull request Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants