Speculative fix for an unused result warning#615
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.