dhemery / DHE-Modules

VCV rack modules from Dale Emery
MIT License
33 stars 2 forks source link

build fail on old GCC #12

Closed davephillips closed 5 years ago

davephillips commented 5 years ago

Fedora 23 Linux Rack 0.6.2c (from source) GCC 5.3.1

Hi Dale ! Trying to build the latest pull throws an error about casting:

g++ -Wsuggest-override -std=c++11 -I./include -DSLUG=DHE-Modules -fPIC -I../../include -I../../dep/include -DVERSION=0.6.4 -MMD -MP -g -O3 -march=athlon-fx -ffast-math -fno-finite-math-only -Wall -Wextra -Wno-unused-parameter -DARCH_LIN -c -o build/src/juster.cpp.o src/juster.cpp In file included from /usr/include/c++/5.3.1/x86_64-redhat-linux/bits/c++allocator.h:33:0, from /usr/include/c++/5.3.1/bits/allocator.h:46, from /usr/include/c++/5.3.1/string:41, from ../../include/util/common.hpp:10, from ../../include/rack.hpp:4, from ./include/dhe-modules.h:3, from src/juster.cpp:1: /usr/include/c++/5.3.1/ext/new_allocator.h: In instantiation of ‘struct gnu_cxx::new_allocator’: /usr/include/c++/5.3.1/bits/allocator.h:92:11: required from ‘class std::allocator’ /usr/include/c++/5.3.1/bits/stl_vector.h:79:14: required from ‘struct std::_Vector_base<const DHE::JusterChannel, std::allocator >::_Vector_impl’ /usr/include/c++/5.3.1/bits/stl_vector.h:164:20: required from ‘struct std::_Vector_base<const DHE::JusterChannel, std::allocator >’ /usr/include/c++/5.3.1/bits/stl_vector.h:214:11: required from ‘class std::vector’ src/juster.cpp:118:69: required from here /usr/include/c++/5.3.1/ext/new_allocator.h:93:7: error: ‘const _Tp* __gnu_cxx::new_allocator<_Tp>::address(gnu_cxx::new_allocator<_Tp>::const_reference) const [with _Tp = const DHE::JusterChannel; gnu_cxx::new_allocator<_Tp>::const_pointer = const DHE::JusterChannel*; gnu_cxx::new_allocator<_Tp>::const_reference = const DHE::JusterChannel&]’ cannot be overloaded address(const_reference x) const _GLIBCXX_NOEXCEPT ^ /usr/include/c++/5.3.1/ext/new_allocator.h:89:7: error: with ‘_Tp* gnu_cxx::new_allocator<_Tp>::address(gnu_cxx::new_allocator<_Tp>::reference) const [with _Tp = const DHE::JusterChannel; gnu_cxx::new_allocator<_Tp>::pointer = const DHE::JusterChannel; gnu_cxx::new_allocator<_Tp>::reference = const DHE::JusterChannel&]’ address(reference __x) const _GLIBCXX_NOEXCEPT ^ /usr/include/c++/5.3.1/ext/new_allocator.h: In instantiation of ‘void gnu_cxx::new_allocator<_Tp>::deallocate(gnu_cxx::new_allocator<_Tp>::pointer, __gnu_cxx::new_allocator<_Tp>::size_type) [with _Tp = const DHE::JusterChannel; gnu_cxx::new_allocator<_Tp>::pointer = const DHE::JusterChannel; gnu_cxx::new_allocator<_Tp>::size_type = long unsigned int]’: /usr/include/c++/5.3.1/bits/alloc_traits.h:517:9: required from ‘static void std::allocator_traits<std::allocator<_CharT> >::deallocate(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, std::allocator_traits<std::allocator<_CharT> >::pointer, std::allocator_traits<std::allocator<_CharT> >::size_type) [with _Tp = const DHE::JusterChannel; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator; std::allocator_traits<std::allocator<_CharT> >::pointer = const DHE::JusterChannel; std::allocator_traits<std::allocator<_CharT> >::size_type = long unsigned int]’ /usr/include/c++/5.3.1/bits/stl_vector.h:178:19: required from ‘void std::_Vector_base<_Tp, _Alloc>::_M_deallocate(std::_Vector_base<_Tp, _Alloc>::pointer, std::size_t) [with _Tp = const DHE::JusterChannel; _Alloc = std::allocator; std::_Vector_base<_Tp, _Alloc>::pointer = const DHE::JusterChannel; std::size_t = long unsigned int]’ /usr/include/c++/5.3.1/bits/stl_vector.h:160:22: required from ‘std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = const DHE::JusterChannel; _Alloc = std::allocator]’ /usr/include/c++/5.3.1/bits/stl_vector.h:375:18: required from ‘std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = const DHE::JusterChannel; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::allocator_type = std::allocator]’ src/juster.cpp:118:69: required from here /usr/include/c++/5.3.1/ext/new_allocator.h:110:26: error: invalid conversion from ‘const void’ to ‘void’ [-fpermissive] { ::operator delete(p); } ^ In file included from /usr/include/c++/5.3.1/ext/new_allocator.h:33:0, from /usr/include/c++/5.3.1/x86_64-redhat-linux/bits/c++allocator.h:33, from /usr/include/c++/5.3.1/bits/allocator.h:46, from /usr/include/c++/5.3.1/string:41, from ../../include/util/common.hpp:10, from ../../include/rack.hpp:4, from ./include/dhe-modules.h:3, from src/juster.cpp:1: /usr/include/c++/5.3.1/new:115:6: note: initializing argument 1 of ‘void operator delete(void)’ void operator delete(void) _GLIBCXX_USE_NOEXCEPT ^ In file included from /usr/include/c++/5.3.1/vector:62:0, from ../../include/util/common.hpp:11, from ../../include/rack.hpp:4, from ./include/dhe-modules.h:3, from src/juster.cpp:1: /usr/include/c++/5.3.1/bits/stl_construct.h: In instantiation of ‘void std::_Construct(_T1, _Args&& ...) [with _T1 = const DHE::JusterChannel; _Args = {const DHE::JusterChannel&}]’: /usr/include/c++/5.3.1/bits/stl_uninitialized.h:75:18: required from ‘static _ForwardIterator std::uninitialized_copy<_TrivialValueTypes>::uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = const DHE::JusterChannel; _ForwardIterator = const DHE::JusterChannel; bool _TrivialValueTypes = false]’ /usr/include/c++/5.3.1/bits/stl_uninitialized.h:126:15: required from ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = const DHE::JusterChannel; _ForwardIterator = const DHE::JusterChannel]’ /usr/include/c++/5.3.1/bits/stl_uninitialized.h:281:37: required from ‘_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = const DHE::JusterChannel; _ForwardIterator = const DHE::JusterChannel; _Tp = const DHE::JusterChannel]’ /usr/include/c++/5.3.1/bits/stl_vector.h:1290:33: required from ‘void std::vector<_Tp, _Alloc>::_M_range_initialize(_ForwardIterator, _ForwardIterator, std::forward_iterator_tag) [with _ForwardIterator = const DHE::JusterChannel; _Tp = const DHE::JusterChannel; _Alloc = std::allocator]’ /usr/include/c++/5.3.1/bits/stl_vector.h:377:21: required from ‘std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = const DHE::JusterChannel; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::allocator_type = std::allocator]’ src/juster.cpp:118:69: required from here /usr/include/c++/5.3.1/bits/stl_construct.h:75:7: error: invalid static_cast from type ‘const DHE::JusterChannel’ to type ‘void’ { ::new(static_cast<void*>(p)) _T1(std::forward<_Args>(args)...); } ^ ../../compile.mk:64: recipe for target 'build/src/juster.cpp.o' failed make: *** [build/src/juster.cpp.o] Error 1

dhemery commented 5 years ago

Thanks. I’ll look into it. A nice reminder that I should have built on Linux before merging to master.

dhemery commented 5 years ago

I've pushed a fix to master. Please try it and let me know how it goes.

davephillips commented 5 years ago

Thanks, Dale, you nailed it. Everything seems in perfect working order now. :)