[PIPE2D-795] Fix clang compile errors/warnings Created: 26/Mar/21  Updated: 27/Mar/21  Resolved: 27/Mar/21

Status: Done
Project: DRP 2-D Pipeline
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Story Priority: Normal
Reporter: price Assignee: price
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Sprint: 2DDRP-2021 A3
Reviewers: hassan

 Description   

Kazumi Murata reports compilation errors when building with clang 12.0.0 on MacOS 11.2.3:

In file included from src/FiberTraceFunction.cc:1:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/algorithm:2690:3: error: static_assert failed
      due to requirement
      '__is_cpp17_forward_iterator<ndarray::detail::BinaryOpIterator<ndarray::ArrayRef<unsigned long, 1, -1>,
      ndarray::ArrayRef<unsigned long, 1, -1>, ndarray::detail::MinusTag::ScalarFunction<unsigned long,
      unsigned long> > >::value' "std::minmax_element requires a ForwardIterator"
  static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value,
  ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/algorithm:2741:19: note: in instantiation of
      function template specialization
      'std::__1::minmax_element<ndarray::detail::BinaryOpIterator<ndarray::ArrayRef<unsigned long, 1, -1>,
      ndarray::ArrayRef<unsigned long, 1, -1>, ndarray::detail::MinusTag::ScalarFunction<unsigned long,
      unsigned long> >, std::__1::__less<unsigned long, unsigned long> >' requested here
    return _VSTD::minmax_element(__first, __last,
                  ^
src/FiberTraceFunction.cc:29:34: note: in instantiation of function template specialization
      'std::__1::minmax_element<ndarray::detail::BinaryOpIterator<ndarray::ArrayRef<unsigned long, 1, -1>,
      ndarray::ArrayRef<unsigned long, 1, -1>, ndarray::detail::MinusTag::ScalarFunction<unsigned long,
      unsigned long> > >' requested here
    auto const leftMinMax = std::minmax_element(leftPixels.begin(), leftPixels.end());
                                 ^
1 error generated.
scons: *** [src/FiberTraceFunction.os] Error 1
scons: building terminated because of errors.


 Comments   
Comment by price [ 26/Mar/21 ]

Since the errors were in old code that we were no longer using, I took the opportunity to remove all the old code: about 10k lines.

pfs_build.sh -b tickets/PIPE2D-795 now works on my Mac.

Comment by hassan [ 27/Mar/21 ]

Changes look fine.

Comment by price [ 27/Mar/21 ]

Merged.

Generated at Sat Feb 10 15:58:11 JST 2024 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.