icecube / photospline

https://docs.icecube.aq/photospline/v2.0.7/
BSD 2-Clause "Simplified" License
5 stars 12 forks source link

volatile-register-variable warning #20

Closed nega0 closed 2 years ago

nega0 commented 2 years ago

Can we pragma around this? At least with -Wno-error?

[ 29%] Building CXX object CMakeFiles/cphotospline.dir/src/cinter/splinetable.cpp.o
In file included from /home/nega/i3/photospline/include/photospline/splinetable.h:838,
                 from /home/nega/i3/photospline/src/cinter/splinetable.cpp:2:
/home/nega/i3/photospline/include/photospline/detail/bspline_multi.h: In member function ‘void photospline::splinetable<Alloc>::ndsplineeval_multibasis_core(const int*, const typename photospline::detail::simd_vector<Float>::type***, typename photospline::detail::simd_vector<Float>::type*) const [with Float = float; Alloc = std::allocator<void>]’:
/home/nega/i3/photospline/include/photospline/detail/bspline_multi.h:10:6: error: optimization may eliminate reads and/or writes to register variables [-Werror=volatile-register-var]
   10 | void splinetable<Alloc>::ndsplineeval_multibasis_core(const int *centers, const typename detail::simd_vector<Float>::type*** localbasis, typename detail::simd_vector<Float>::type* result) const{
      |      ^~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
cnweaver commented 2 years ago

We might want to clean up this warning (as I'm not sure we still need the stack realignment thing it was there to perform), but I agree, -Werror has got to go. It will always keep going off any time someone has a slightly newer compiler than the last person who worked on the code.