g++
polluks opened this issue · 1 comments
polluks commented
g++ -Wno-multichar -Isrc -std=c++14 -fno-rtti -o LZCBDecompressor.o -c src/LZCBDecompressor.cpp
src/LZCBDecompressor.cpp:141:59: error: conflicting declaration 'constexpr const std::array<unsigned int, FrequencyTree<T>::levels()> FrequencyTree<T>::_levelOffsets'
141 | constexpr std::array<uint32_t,FrequencyTree<T>::levels()> FrequencyTree<T>::_levelOffsets;
| ^~~~~~~~~~~~~~~~
src/LZCBDecompressor.cpp:134:49: note: previous declaration as 'constexpr const std::array<unsigned int, FrequencyTree<T>::levels()> FrequencyTree<T>::_levelOffsets'
134 | static constexpr std::array<uint32_t,levels()> _levelOffsets=makeArray(makeLevelOffsetSequence(std::make_integer_sequence<uint32_t,levels()>{}));
| ^~~~~~~~~~~~~
src/LZCBDecompressor.cpp:144:59: error: conflicting declaration 'constexpr const std::array<unsigned int, FrequencyTree<T>::levels()> FrequencyTree<T>::_levelSizes'
144 | constexpr std::array<uint32_t,FrequencyTree<T>::levels()> FrequencyTree<T>::_levelSizes;
| ^~~~~~~~~~~~~~~~
src/LZCBDecompressor.cpp:135:49: note: previous declaration as 'constexpr const std::array<unsigned int, FrequencyTree<T>::levels()> FrequencyTree<T>::_levelSizes'
135 | static constexpr std::array<uint32_t,levels()> _levelSizes=makeArray(makeLevelSizeSequence(std::make_integer_sequence<uint32_t,levels()>{}));
| ^~~~~~~~~~~
BTW https://stackoverflow.com/questions/45918292/gcc-equivalent-of-wshorten-64-to-32
temisu commented
This seems to be non-standard behavior from gcc, which enables c++17 static member behavior even when c++14 standard is defined from command line.
I added #ifdef to the code, it should now compile cleanly if you change the standard to c++17 from the Makefile. Also changed the narrowing flag