Skip to content

Speculative fix for an unused result warning#615

Merged
jennybc merged 2 commits intomainfrom
unused-result-warning
Mar 4, 2026
Merged

Speculative fix for an unused result warning#615
jennybc merged 2 commits intomainfrom
unused-result-warning

Conversation

@jennybc
Copy link
Member

@jennybc jennybc commented Mar 4, 2026

No description provided.

jennybc added 2 commits March 4, 2026 11:35
Trying to replicate this (on r-hub):

Version: 1.7.0
Check: whether package can be installed
Result: WARN
  Found the following significant warnings:
    vroom_write.cc:406:5: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result]
  See ‘/data/gannet/ripley/R/packages/tests-clang/vroom.Rcheck/00install.out’ for details.
  * used C compiler: ‘clang version 22.1.0 (https://github.com/llvm/llvm-project 4434dabb69916856b824f68a64b029c67175e532)’
  * used C++ compiler: ‘clang version 22.1.0 (https://github.com/llvm/llvm-project 4434dabb69916856b824f68a64b029c67175e532)’
Flavor: r-devel-linux-x86_64-fedora-clang
I just happened to see this CRAN warning, which appears to surface with clang 22.1.0. The `[[nodiscard]]` attribute was added to `std::future::get()` as part of llvm/llvm-project#172124.

I can't replicate it locally or on any of the r-hub platforms, because none use a recent enough clang. But the fix seems fairly innocuous and makes sense.

This was the CRAN result at the time I did this:

Version: 1.7.0
Check: whether package can be installed
Result: WARN
  Found the following significant warnings:
    vroom_write.cc:406:5: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result]
  See ‘/data/gannet/ripley/R/packages/tests-clang/vroom.Rcheck/00install.out’ for details.
  * used C compiler: ‘clang version 22.1.0 (https://github.com/llvm/llvm-project 4434dabb69916856b824f68a64b029c67175e532)’
  * used C++ compiler: ‘clang version 22.1.0 (https://github.com/llvm/llvm-project 4434dabb69916856b824f68a64b029c67175e532)’
Flavor: r-devel-linux-x86_64-fedora-clang
@jennybc jennybc merged commit 60111f6 into main Mar 4, 2026
18 checks passed
@jennybc jennybc deleted the unused-result-warning branch March 4, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant