Skip to content
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

Don't use std version of nextafter #1739

Closed
wants to merge 1 commit into from
Closed

Don't use std version of nextafter #1739

wants to merge 1 commit into from

Conversation

neheb
Copy link
Contributor

@neheb neheb commented Aug 30, 2019

nextafter is C++11. std version is not available with either uClibc++ or uClibc-ng.

Fixes this: https://downloads.openwrt.org/releases/faillogs-19.07/arc_arc700/packages/measurement-kit/compile.txt

@neheb
Copy link
Contributor Author

neheb commented Aug 30, 2019

Alternate fix for this: facebook/folly@e265e1e

I don't know if it is applicable here.

@codecov
Copy link

codecov bot commented Sep 1, 2019

Codecov Report

Merging #1739 into master will decrease coverage by 0.27%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1739      +/-   ##
==========================================
- Coverage   87.03%   86.77%   -0.27%     
==========================================
  Files         136      136              
  Lines        5275     5335      +60     
==========================================
+ Hits         4591     4629      +38     
- Misses        684      706      +22

@codecov
Copy link

codecov bot commented Sep 1, 2019

Codecov Report

Merging #1739 into master will decrease coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1739      +/-   ##
==========================================
- Coverage   87.03%   87.03%   -<.01%     
==========================================
  Files         136      136              
  Lines        5275     5274       -1     
==========================================
- Hits         4591     4590       -1     
  Misses        684      684

nextafter is C++11. std version is not available with either uClibc++ or uClibc-ng.
@neheb
Copy link
Contributor Author

neheb commented Sep 3, 2019

Build failure is unrelated.

@horenmar
Copy link
Member

horenmar commented Sep 6, 2019

This change would not work -- you use nextafterf, which operates on, and returns, floats. This would break when step is used with doubles.

I'll take a stab at fixing this later.

@horenmar
Copy link
Member

horenmar commented Sep 6, 2019

Okay, master should now support this. Can you test it?

@neheb neheb deleted the patch-1 branch September 6, 2019 20:27
@neheb
Copy link
Contributor Author

neheb commented Sep 6, 2019

Didn't work

./include/private/catch.hpp: In function 'FP {anonymous}::step(FP, FP, int)':
./include/private/catch.hpp:11127:22: error: 'nextafter' is not a member of 'std'; did you mean 'nextafter'?
11127 |         start = std::nextafter(start, direction);
      |                      ^~~~~~~~~
In file included from /home/mangix/devstuff/openwrt/staging_dir/toolchain-arc_arc700_gcc-9.2.0_uClibc/include/features.h:395,
                 from /home/mangix/devstuff/openwrt/staging_dir/toolchain-arc_arc700_gcc-9.2.0_uClibc/arc-openwrt-linux-uclibc/include/c++/9.2.0/arc-openwrt-linux-uclibc/bits/os_defines.h:39,
                 from /home/mangix/devstuff/openwrt/staging_dir/toolchain-arc_arc700_gcc-9.2.0_uClibc/arc-openwrt-linux-uclibc/include/c++/9.2.0/arc-openwrt-linux-uclibc/bits/c++config.h:524,
                 from /home/mangix/devstuff/openwrt/staging_dir/toolchain-arc_arc700_gcc-9.2.0_uClibc/arc-openwrt-linux-uclibc/include/c++/9.2.0/iosfwd:38,
                 from ./include/private/catch.hpp:440,
                 from test/main.cpp:1:
/home/mangix/devstuff/openwrt/staging_dir/toolchain-arc_arc700_gcc-9.2.0_uClibc/include/bits/mathcalls.h:295:1: note: 'nextafter' declared here
  295 | __MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__))

Not sure why.

@neheb
Copy link
Contributor Author

neheb commented Sep 6, 2019

Ah it's this: addf799#diff-a010dcdfe8ba1736a2dc3acde52c3e89R314

One space after # works. Two do not.

@neheb
Copy link
Contributor Author

neheb commented Sep 6, 2019

Actually hmmm. That's not it. For some reason, the UCLIBC line is not evaluating to true.

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.

2 participants