Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Fails to build on Gentoo with clang-17 #945

Open
NHOrus opened this issue Mar 25, 2024 · 0 comments
Open

[BUG] Fails to build on Gentoo with clang-17 #945

NHOrus opened this issue Mar 25, 2024 · 0 comments

Comments

@NHOrus
Copy link

NHOrus commented Mar 25, 2024

As part of preparing for future mandatory errors in gcc-14, we are rebuilding software with increased amount of warnings.

https://bugs.gentoo.org/919287

This failure happens on Gentoo with Clang-17, and most likely would happen on incoming GCC-14

Errors of compilation:

/var/tmp/portage/games-engines/odamex-10.4.0-r2/work/odamex-src-10.4.0/common/m_wdlstats.cpp:181:6: error: non-constant-expression cannot be narrowed from type 'size_type' (aka 'unsigned long') to 'int' in initializer list [-Wc++11-narrowing]
  181 |             ::wdlplayers.size() + 1,
      |             ^~~~~~~~~~~~~~~~~~~~~~~
/var/tmp/portage/games-engines/odamex-10.4.0-r2/work/odamex-src-10.4.0/common/m_wdlstats.cpp:181:6: note: insert an explicit cast to silence this issue
  181 |             ::wdlplayers.size() + 1,
      |             ^~~~~~~~~~~~~~~~~~~~~~~
      |             static_cast<int>(      )
/var/tmp/portage/games-engines/odamex-10.4.0-r2/work/odamex-src-10.4.0/common/m_wdlstats.cpp:213:35: error: non-constant-expression cannot be narrowed from type 'size_type' (aka 'unsigned long') to 'int' in initializer list [-Wc++11-narrowing]
  213 |         WDLPlayerSpawn wdlplayerspawn = {::wdlplayerspawns.size() + 1, mthing->x, mthing->y,
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/tmp/portage/games-engines/odamex-10.4.0-r2/work/odamex-src-10.4.0/common/m_wdlstats.cpp:213:35: note: insert an explicit cast to silence this issue
  213 |         WDLPlayerSpawn wdlplayerspawn = {::wdlplayerspawns.size() + 1, mthing->x, mthing->y,
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                          static_cast<int>(           )
/var/tmp/portage/games-engines/odamex-10.4.0-r2/work/odamex-src-10.4.0/common/m_wdlstats.cpp:280:31: error: non-constant-expression cannot be narrowed from type 'size_type' (aka 'unsigned long') to 'int' in initializer list [-Wc++11-narrowing]
  280 |         WDLItemSpawn wdlitemspawn = {::wdlitemspawns.size() + 1, target->x, target->y,
      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~
/var/tmp/portage/games-engines/odamex-10.4.0-r2/work/odamex-src-10.4.0/common/m_wdlstats.cpp:280:31: note: insert an explicit cast to silence this issue
  280 |         WDLItemSpawn wdlitemspawn = {::wdlitemspawns.size() + 1, target->x, target->y,
      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                      static_cast<int>(         )
/var/tmp/portage/games-engines/odamex-10.4.0-r2/work/odamex-src-10.4.0/common/p_acs.cpp:1927:17: error: non-constant-expression cannot be narrowed from type 'uint32_t' (aka 'unsigned int') to 'int' in initializer list [-Wc++11-narrowing]
 1927 |                 int argv[] = {actor->netid, special, arg1, arg2, arg3, arg4, arg5};
      |                               ^~~~~~~~~~~~
/var/tmp/portage/games-engines/odamex-10.4.0-r2/work/odamex-src-10.4.0/common/p_acs.cpp:1927:17: note: insert an explicit cast to silence this issue
 1927 |                 int argv[] = {actor->netid, special, arg1, arg2, arg3, arg4, arg5};
      |                               ^~~~~~~~~~~~
      |                               static_cast<int>( )
/var/tmp/portage/games-engines/odamex-10.4.0-r2/work/odamex-src-10.4.0/common/p_acs.cpp:1961:17: error: non-constant-expression cannot be narrowed from type 'long' to 'int' in initializer list [-Wc++11-narrowing]
 1961 |                 int argv[] = {sec - sectors, index};
      |                               ^~~~~~~~~~~~~
/var/tmp/portage/games-engines/odamex-10.4.0-r2/work/odamex-src-10.4.0/common/p_acs.cpp:1961:17: note: insert an explicit cast to silence this issue
 1961 |                 int argv[] = {sec - sectors, index};
      |                               ^~~~~~~~~~~~~
      |                               static_cast<int>( )

see also #826

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants