Skip to content

AudioDriver.cpp fails to build with gcc-16.1 #1938

@stefson

Description

@stefson

hello everyone, gcc-16.1.0 got released and it fails to compile the AudioDriver.cpp file:

FAILED: [code=1] libs/driver/CMakeFiles/audiodrv.dir/src/AudioDriver.cpp.o 
/usr/bin/g++-16 -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DBOOST_NOWIDE_DYN_LINK -DBOOST_NOWIDE_NO_LIB -DBUILD_DLL -DHAVE_STRUCT_TIMESPEC -I/var/tmp/portage/games-strategy/s25rttr-9999-r6/work/s25rttr-9999/libs/driver/include -I/var/tmp/portage/games-strategy/s25rttr-9999-r6/work/s25rttr-9999/libs/common/include -I/var/tmp/portage/games-strategy/s25rttr-9999-r6/work/s25rttr-9999/external/libutil/libs/common/include -I/var/tmp/portage/games-strategy/s25rttr-9999-r6/work/s25rttr-9999/external/libendian/include -I/var/tmp/portage/games-strategy/s25rttr-9999-r6/work/s25rttr-9999/external/libutil/libs/log/include  -O2 -march=znver1 -pipe -std=gnu++14  -ggdb -std=c++17 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -mfpmath=sse -msse2 -Wall -pedantic -Wextra -Werror -fno-strict-aliasing -pedantic-errors -Wcast-qual -Wdisabled-optimization -Wfloat-conversion -Wformat-nonliteral -Wformat-security -Wformat=2 -Wimport -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wpacked -Wparentheses -Wpedantic -Wpointer-arith -Wstrict-aliasing=2 -Wundef -Wunused -Wunused-parameter -Wwrite-strings -Wno-unknown-pragmas -Wctor-dtor-privacy -Woverloaded-virtual -Wstrict-null-sentinel -Wno-maybe-uninitialized -Wno-dangling-reference -Wredundant-decls -Wsuggest-override -Wno-error=suggest-override -Wnoexcept -Wunreachable-code -MD -MT libs/driver/CMakeFiles/audiodrv.dir/src/AudioDriver.cpp.o -MF libs/driver/CMakeFiles/audiodrv.dir/src/AudioDriver.cpp.o.d -o libs/driver/CMakeFiles/audiodrv.dir/src/AudioDriver.cpp.o -c /var/tmp/portage/games-strategy/s25rttr-9999-r6/work/s25rttr-9999/libs/driver/src/AudioDriver.cpp
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/16/include/g++-v16/string:52,
                 from /var/tmp/portage/games-strategy/s25rttr-9999-r6/work/s25rttr-9999/libs/driver/include/driver/AudioInterface.h:11,
                 from /var/tmp/portage/games-strategy/s25rttr-9999-r6/work/s25rttr-9999/libs/driver/include/driver/AudioDriver.h:7,
                 from /var/tmp/portage/games-strategy/s25rttr-9999-r6/work/s25rttr-9999/libs/driver/src/AudioDriver.cpp:5:
/usr/lib/gcc/x86_64-pc-linux-gnu/16/include/g++-v16/bits/stl_function.h: In instantiation of ‘constexpr decltype ((forward<_Tp>(__t) == forward<_Up>(__u))) std::equal_to<void>::operator()(_Tp&&, _Up&&) const [with _Tp = driver::RawSoundHandle&; _Up = const driver::RawSoundHandle&; decltype ((forward<_Tp>(__t) == forward<_Up>(__u))) = bool]’:
/usr/lib/gcc/x86_64-pc-linux-gnu/16/include/g++-v16/bits/predefined_ops.h:81:17:   required from ‘constexpr bool __gnu_cxx::__ops::_Comp_with_val<_Func, _Value, _Val_2nd>::operator()(_Tp&&) [with _Tp = driver::RawSoundHandle&; _Func = std::equal_to<void>; _Value = driver::RawSoundHandle; bool _Val_2nd = true]’
   81 |             return _M_f(__arg, _M_val);
      |                    ~~~~^~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/16/include/g++-v16/bits/stl_algobase.h:2100:42:   required from ‘_Iterator std::__find_if(_Iterator, _Iterator, _Predicate) [with _Iterator = __gnu_cxx::__normal_iterator<driver::RawSoundHandle*, vector<driver::RawSoundHandle> >; _Predicate = __gnu_cxx::__ops::_Comp_with_val<equal_to<void>, driver::RawSoundHandle, true>]’
 2100 |       while (__first != __last && !__pred(*__first))
      |                                    ~~~~~~^~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/16/include/g++-v16/bits/stl_algo.h:3873:28:   required from ‘_IIter std::find(_IIter, _IIter, const _Tp&) [with _IIter = __gnu_cxx::__normal_iterator<driver::RawSoundHandle*, vector<driver::RawSoundHandle> >; _Tp = driver::RawSoundHandle]’
 3873 |       return std::__find_if(__first, __last,
      |              ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
 3874 |                             __gnu_cxx::__ops::__equal_to(__val));
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/tmp/portage/games-strategy/s25rttr-9999-r6/work/s25rttr-9999/libs/common/include/helpers/containerUtils.h:95:25:   required from ‘auto helpers::find(T&, const U&) [with T = std::vector<driver::RawSoundHandle>; U = driver::RawSoundHandle]’
   95 |         return std::find(begin(container), end(container), value);
      |                ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/tmp/portage/games-strategy/s25rttr-9999-r6/work/s25rttr-9999/libs/driver/src/AudioDriver.cpp:65:34:   required from here
   65 |     const auto it = helpers::find(loadedSounds_, handle);
      |                     ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/16/include/g++-v16/bits/stl_function.h:500:18: error: noexcept-expression evaluates to ‘false’ because of a call to ‘bool driver::RawSoundHandle::operator==(const driver::RawSoundHandle&) const’ [-Werror=noexcept]
  500 |         noexcept(noexcept(std::forward<_Tp>(__t) == std::forward<_Up>(__u)))
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /var/tmp/portage/games-strategy/s25rttr-9999-r6/work/s25rttr-9999/libs/driver/include/driver/AudioInterface.h:8:
/var/tmp/portage/games-strategy/s25rttr-9999-r6/work/s25rttr-9999/libs/driver/include/driver/RawSoundHandle.h:30:10: note: but ‘bool driver::RawSoundHandle::operator==(const driver::RawSoundHandle&) const’ does not throw; perhaps it should be declared ‘noexcept’
   30 |     bool operator==(const RawSoundHandle& rhs) const { return driverData == rhs.driverData; }
      |          ^~~~~~~~
cc1plus: all warnings being treated as errors

full and compressed build.log:

build.log.gz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions