Skip to content

ARROW-17803: [C++] Use [[nodiscard]] - #14193

Merged
pitrou merged 2 commits into
apache:masterfrom
pitrou:ARROW-17803-no-discard
Sep 22, 2022
Merged

ARROW-17803: [C++] Use [[nodiscard]]#14193
pitrou merged 2 commits into
apache:masterfrom
pitrou:ARROW-17803-no-discard

Conversation

@pitrou

Copy link
Copy Markdown
Member

C++17 supports the standard attribute [[nodiscard]], use that instead of the clang-specific __attribute__((warn_unused_result)).

@pitrou

Copy link
Copy Markdown
MemberAuthor

@js8544 For the record, it seems this version works around the GCC parser issue.

@pitrou

This comment was marked as outdated.

@js8544

Copy link
Copy Markdown
Contributor

@js8544 For the record, it seems this version works around the GCC parser issue.

Nice!

@pitrou

Copy link
Copy Markdown
MemberAuthor

Linker issue which suggests the ARROW_FRIEND_EXPORT macro isn't right...
https://github.com/pitrou/arrow/actions/runs/3098917212/jobs/5017418044#step:7:1065

D:/a/_temp/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: src/arrow/CMakeFiles/arrow_testing_shared.dir/testing/gtest_util.cc.obj:gtest_util.cc:(.text$_ZN7testing13PrintToStringISt10shared_ptrIN5arrow6SchemaEEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_[_ZN7testing13PrintToStringISt10shared_ptrIN5arrow6SchemaEEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_]+0x69): undefined reference to `arrow::PrintTo(arrow::Schema const&, std::ostream*)'
D:/a/_temp/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: src/arrow/CMakeFiles/arrow_testing_shared.dir/compute/exec/test_util.cc.obj:test_util.cc:(.text+0x893): undefined reference to `arrow::compute::PrintTo(arrow::compute::Expression const&, std::ostream*)'
D:/a/_temp/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: src/arrow/CMakeFiles/arrow_testing_shared.dir/compute/exec/test_util.cc.obj:test_util.cc:(.text+0x988): undefined reference to `arrow::compute::PrintTo(arrow::compute::Expression const&, std::ostream*)'

@pitrou
pitrouforce-pushed the ARROW-17803-no-discard branch from 81283a1 to aef9c93CompareSeptember 21, 2022 15:51
@github-actions

Copy link
Copy Markdown

@pitrou

This comment was marked as outdated.

@pitrou
pitrouforce-pushed the ARROW-17803-no-discard branch from c755a32 to 95c9694CompareSeptember 22, 2022 09:31
@pitrou

Copy link
Copy Markdown
MemberAuthor

Revision: 95c9694bc6a38241a0cbaee9c310b21363662081

Submitted crossbow builds: ursacomputing/crossbow @ nodiscard-2

TaskStatus
test-alpine-linux-cppGithub Actions
test-build-cpp-fuzzGithub Actions
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-debian-10-cpp-amd64Github Actions
test-debian-10-cpp-i386Github Actions
test-debian-11-cpp-amd64Github Actions
test-debian-11-cpp-i386Github Actions
test-fedora-35-cppGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-bundledGithub Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions
test-ubuntu-22.04-cppGithub Actions

Comment threadcpp/src/arrow/util/visibility.h Outdated
Comment threadcpp/src/arrow/util/future.h Outdated
C++17 supports the standard attribute `[[nodiscard]]`, use that instead of the clang-specific `__attribute__((warn_unused_result))`.
@pitrou
pitrouforce-pushed the ARROW-17803-no-discard branch from 95c9694 to 8a78d6bCompareSeptember 22, 2022 13:29
@pitrou
pitrouforce-pushed the ARROW-17803-no-discard branch from 8a78d6b to 29d4bfaCompareSeptember 22, 2022 13:32
@pitrou
pitrou merged commit 5256e43 into apache:masterSep 22, 2022
@pitrou
pitrou deleted the ARROW-17803-no-discard branch September 22, 2022 14:59
@ursabot

Copy link
Copy Markdown

Benchmark runs are scheduled for baseline = f477a97 and contender = 5256e43. 5256e43 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Failed ⬇️1.09% ⬆️0.14%] test-mac-arm
[Failed ⬇️1.37% ⬆️0.27%] ursa-i9-9960x
[Finished ⬇️0.25% ⬆️0.0%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] 5256e434 ec2-t3-xlarge-us-east-2
[Failed] 5256e434 test-mac-arm
[Failed] 5256e434 ursa-i9-9960x
[Finished] 5256e434 ursa-thinkcentre-m75q
[Finished] f477a972 ec2-t3-xlarge-us-east-2
[Failed] f477a972 test-mac-arm
[Failed] f477a972 ursa-i9-9960x
[Finished] f477a972 ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@ursabot

Copy link
Copy Markdown

['Python', 'R'] benchmarks have high level of regressions.
ursa-i9-9960x

zagto pushed a commit to zagto/arrow that referenced this pull request Oct 7, 2022
C++17 supports the standard attribute `[[nodiscard]]`, use that instead of the clang-specific `__attribute__((warn_unused_result))`.
Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
@asfimportasfimport mentioned this pull request Sep 23, 2022
Sign up for freeto 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.

4 participants

@pitrou@js8544@ursabot@lidavidm