scp-fs2open / scp-fs2open/fs2open.github.com
Solaris 11.4 (2018 build) GCC 7.3.0 warnings in current master
- Dominant language
- C++
- Stars
- 487
- Forks
- 184
- PR merge metrics
- PR metrics pending
Description
After looking into whether I can still compile on Solaris with latest master, as I had a previous Solaris warnings ticket open until recently, turns out after patching a few issues, I can compile, which now results in all these new warnings.
I can't use the latest Solaris 11.4 currently, which comes with GCC 11, as it also includes a copy of the library fribidi, which is also installed by the only (outdated) ffmpeg build currently available in an IPS repository, and the two would conflict. May try to set up a boot environment that has an updated 11.4 and build/install ffmpeg from scratch following a guide I found, but the IPS packaging step wasn't working so far. Guessing I can just install it like I did SDL2 though, instead of messing with IPS. All that said, I don't think anything other than the GCC version itself would affect these warnings.
```[ 50%] Building CXX object code/CMakeFiles/code.dir/cmeasure/cmeasure.cpp.o
/usr/share/games/fs2source/fs2_open/code/cfile/cfilesystem.cpp: In function ‘void cf_build_file_list()’:
/usr/share/games/fs2source/fs2_open/code/cfile/cfilesystem.cpp:1175:71: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat=]
"%lu file(s) detected, including:\n%s", count, shadowed.c_str());
^
```
```[ 54%] Building CXX object code/CMakeFiles/code.dir/graphics/line_draw_list.cpp.o
/usr/share/games/fs2source/fs2_open/code/graphics/grbatch.cpp: In member function ‘void geometry_batcher::allocate(int, int)’:
/usr/share/games/fs2source/fs2_open/code/graphics/grbatch.cpp:64:52: warning: declaration of ‘quad’ shadows a global declaration [-Wshadow]
void geometry_batcher::allocate(int quad, int n_tri)
^
In file included from /usr/include/string.h:15:0,
from /usr/gcc/7/include/c++/7.3.0/cstring:42,
from /usr/share/games/fs2source/fs2_open/code/prefix_header.h:8,
from /usr/share/games/fs2source/fs2_open/build/code/cotire/code_CXX_prefix.cxx:4,
from /usr/share/games/fs2source/fs2_open/build/code/cotire/code_CXX_prefix.hxx:4:
/usr/include/sys/types.h:642:17: note: shadowed declaration is here
typedef quad_t quad; /* used by UFS */
^~~~
/usr/share/games/fs2source/fs2_open/code/graphics/grbatch.cpp: In member function ‘void geometry_batcher::add_allocate(int, int)’:
/usr/share/games/fs2source/fs2_open/code/graphics/grbatch.cpp:81:56: warning: declaration of ‘quad’ shadows a global declaration [-Wshadow]
void geometry_batcher::add_allocate(int quad, int n_tri)
^
In file included from /usr/include/string.h:15:0,
from /usr/gcc/7/include/c++/7.3.0/cstring:42,
from /usr/share/games/fs2source/fs2_open/code/prefix_header.h:8,
from /usr/share/games/fs2source/fs2_open/build/code/cotire/code_CXX_prefix.cxx:4,
from /usr/share/games/fs2source/fs2_open/build/code/cotire/code_CXX_prefix.hxx:4:
/usr/include/sys/types.h:642:17: note: shadowed declaration is here
typedef quad_t quad; /* used by UFS */
^~~~
```
```[ 64%] Building CXX object code/CMakeFiles/code.dir/model/modelinterp.cpp.o
In file included from /usr/share/games/fs2source/fs2_open/code/math/vecmat.h:15:0,
from /usr/share/games/fs2source/fs2_open/code/model/modelanimation.h:4,
from /usr/share/games/fs2source/fs2_open/code/model/modelanimation.cpp:1:
/usr/share/games/fs2source/fs2_open/code/globalincs/pstypes.h: In instantiation of ‘special_flag_def_list_new::special_flag_def_list_new(const char*, T, bool) [with T = animation::Animation_Flags; additional_args = {animation::ModelAnimation&}]’:
/usr/share/games/fs2source/fs2_open/code/model/modelanimation.cpp:29:2: required from here
/usr/share/games/fs2source/fs2_open/code/globalincs/pstypes.h:241:2: warning: declaration of ‘in_use’ shadows a member of ‘special_flag_def_list_new’ [-Wshadow]
special_flag_def_list_new(const char* name, T flag, bool in_use) : flag_def_list_new{ name, flag, in_use, false } {}
^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/share/games/fs2source/fs2_open/code/globalincs/pstypes.h:230:10: note: shadowed declaration is here
bool in_use; // Whether or not this flag is currently in use or obsolete
^~~~~~
/usr/share/games/fs2source/fs2_open/code/globalincs/pstypes.h:241:2: warning: declaration of ‘name’ shadows a member of ‘special_flag_def_list_new’ [-Wshadow]
special_flag_def_list_new(const char* name, T flag, bool in_use) : flag_def_list_new{ name, flag, in_use, false } {}
^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/share/games/fs2source/fs2_open/code/globalincs/pstypes.h:228:17: note: shadowed declaration is here
const char* name; // The parseable representation of this flag
^~~~
/usr/share/games/fs2source/fs2_open/code/globalincs/pstypes.h: In instantiation of ‘special_flag_def_list_new::special_flag_def_list_new(const char*, T, bool, decltype (((special_flag_def_list_new*)(void)0)->special_flag_def_list_new::parse_special)&) [with T = animation::Animation_Flags; additional_args = {animation::ModelAnimation&}; decltype (((special_flag_def_list_new*)(void)0)->special_flag_def_list_new::parse_special) = std::function&, animation::ModelAnimation&)>]’:
/usr/share/games/fs2source/fs2_open/code/model/modelanimation.cpp:29:2: required from here
/usr/share/games/fs2source/fs2_open/code/globalincs/pstypes.h:242:2: warning: declaration of ‘in_use’ shadows a member of ‘special_flag_def_list_new’ [-Wshadow]
special_flag_def_list_new(const char* name, T flag, bool in_use, const decltype(parse_special)& parseSpecial) : flag_def_list_new{ name, flag, in_use, true }, parse_special(parseSpecial) { }
^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/share/games/fs2source/fs2_open/code/globalincs/pstypes.h:230:10: note: shadowed declaration is here
bool in_use; // Whether or not this flag is currently in use or obsolete
^~~~~~
/usr/share/games/fs2source/fs2_open/code/globalincs/pstypes.h:242:2: warning: declaration of ‘name’ shadows a member of ‘special_flag_def_list_new’ [-Wshadow]
special_flag_def_list_new(const char* name, T flag, bool in_use, const decltype(parse_special)& parseSpecial) : flag_def_list_new{ name, flag, in_use, true }, parse_special(parseSpecial) { }
^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/share/games/fs2source/fs2_open/code/globalincs/pstypes.h:228:17: note: shadowed declaration is here
const char* name; // The parseable representation of this flag
^~~~
```
```[ 64%] Building CXX object code/CMakeFiles/code.dir/model/modelreplace.cpp.o
/usr/share/games/fs2source/fs2_open/code/model/modelread.cpp: In function ‘uint align_bsp_data(ubyte*, ubyte*, uint)’:
/usr/share/games/fs2source/fs2_open/code/model/modelread.cpp:6126:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (bsp_chunk_size > max_size) {
~~~~~~~~~~~~~~~^~~~~~~~~~
```
```[ 66%] Building CXX object code/CMakeFiles/code.dir/network/multi_ping.cpp.o
/usr/share/games/fs2source/fs2_open/code/network/multi_obj.cpp: In function ‘int multi_oo_pack_data(net_player*, object*, ushort, ubyte*)’:
/usr/share/games/fs2source/fs2_open/code/network/multi_obj.cpp:1353:9: warning: declaration of ‘quad’ shadows a global declaration [-Wshadow]
float quad = shield_get_max_quad(objp);
^~~~
In file included from /usr/include/string.h:15:0,
from /usr/gcc/7/include/c++/7.3.0/cstring:42,
from /usr/share/games/fs2source/fs2_open/code/prefix_header.h:8,
from /usr/share/games/fs2source/fs2_open/build/code/cotire/code_CXX_prefix.cxx:4,
from /usr/share/games/fs2source/fs2_open/build/code/cotire/code_CXX_prefix.hxx:4:
/usr/include/sys/types.h:642:17: note: shadowed declaration is here
typedef quad_t quad; /* used by UFS */
^~~~
/usr/share/games/fs2source/fs2_open/code/network/multi_obj.cpp: In function ‘int multi_oo_unpack_data(net_player*, ubyte*, int, int)’:
/usr/share/games/fs2source/fs2_open/code/network/multi_obj.cpp:1892:9: warning: declaration of ‘quad’ shadows a global declaration [-Wshadow]
float quad = shield_get_max_quad(pobjp);
^~~~
In file included from /usr/include/string.h:15:0,
from /usr/gcc/7/include/c++/7.3.0/cstring:42,
from /usr/share/games/fs2source/fs2_open/code/prefix_header.h:8,
from /usr/share/games/fs2source/fs2_open/build/code/cotire/code_CXX_prefix.cxx:4,
from /usr/share/games/fs2source/fs2_open/build/code/cotire/code_CXX_prefix.hxx:4:
/usr/include/sys/types.h:642:17: note: shadowed declaration is here
typedef quad_t quad; /* used by UFS */
^~~~
```
```[ 67%] Building CXX object code/CMakeFiles/code.dir/network/psnet2.cpp.o
/usr/share/games/fs2source/fs2_open/code/network/psnet2.cpp: In function ‘void psnet_debug_bad_packet(int, const uint8_t*, ssize_t, const sockaddr_in6*)’:
/usr/share/games/fs2source/fs2_open/code/network/psnet2.cpp:1300:168: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘size_t {aka unsigned int}’ [-Wformat=]
ml_printf("WARNING: Invalid packet log window reset ... %lu non-logged packets received during previous window!", Psnet_bad_packet_count - MAX_BAD_PACKETS_PER_WINDOW);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
```
```[ 68%] Building CXX object code/CMakeFiles/code.dir/object/objectshield.cpp.o
/usr/share/games/fs2source/fs2_open/code/object/objectshield.cpp: In function ‘void shield_add_strength(object*, float)’:
/usr/share/games/fs2source/fs2_open/code/object/objectshield.cpp:116:11: warning: declaration of ‘quad’ shadows a global declaration [-Wshadow]
float quad = shield_get_quad(objp, i);
^~~~
In file included from /usr/include/string.h:15:0,
from /usr/gcc/7/include/c++/7.3.0/cstring:42,
from /usr/share/games/fs2source/fs2_open/code/prefix_header.h:8,
from /usr/share/games/fs2source/fs2_open/build/code/cotire/code_CXX_prefix.cxx:4,
from /usr/share/games/fs2source/fs2_open/build/code/cotire/code_CXX_prefix.hxx:4:
/usr/include/sys/types.h:642:17: note: shadowed declaration is here
typedef quad_t quad; /* used by UFS */
^~~~
```
```[ 88%] Building CXX object code/CMakeFiles/code.dir/embedded_files/default-material.vert.spv.glsl.cpp.o
In file included from /usr/share/games/fs2source/fs2_open/code/asteroid/asteroid.h:16:0,
from /usr/share/games/fs2source/fs2_open/code/weapon/weapons.cpp:16:
/usr/share/games/fs2source/fs2_open/code/globalincs/pstypes.h: In instantiation of ‘special_flag_def_list_new::special_flag_def_list_new(const char*, T, bool, decltype (((special_flag_def_list_new*)(void)0)->special_flag_def_list_new::parse_special)&) [with T = Weapon::Info_Flags; additional_args = {weapon_info*, flagset&}; decltype (((special_flag_def_list_new*)(void)0)->special_flag_def_list_new::parse_special) = std::function&, weapon_info*, flagset&)>]’:
/usr/share/games/fs2source/fs2_open/code/weapon/weapons.cpp:249:1: required from here
/usr/share/games/fs2source/fs2_open/code/globalincs/pstypes.h:242:2: warning: declaration of ‘in_use’ shadows a member of ‘special_flag_def_list_new&>’ [-Wshadow]
special_flag_def_list_new(const char* name, T flag, bool in_use, const decltype(parse_special)& parseSpecial) : flag_def_list_new{ name, flag, in_use, true }, parse_special(parseSpecial) { }
^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/share/games/fs2source/fs2_open/code/globalincs/pstypes.h:230:10: note: shadowed declaration is here
bool in_use; // Whether or not this flag is currently in use or obsolete
^~~~~~
/usr/share/games/fs2source/fs2_open/code/globalincs/pstypes.h:242:2: warning: declaration of ‘name’ shadows a member of ‘special_flag_def_list_new&>’ [-Wshadow]
special_flag_def_list_new(const char* name, T flag, bool in_use, const decltype(parse_special)& parseSpecial) : flag_def_list_new{ name, flag, in_use, true }, parse_special(parseSpecial) { }
^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/share/games/fs2source/fs2_open/code/globalincs/pstypes.h:228:17: note: shadowed declaration is here
const char* name; // The parseable representation of this flag
^~~~
/usr/share/games/fs2source/fs2_open/code/globalincs/pstypes.h: In instantiation of ‘special_flag_def_list_new::special_flag_def_list_new(const char*, T, bool) [with T = Weapon::Info_Flags; additional_args = {weapon_info*, flagset&}]’:
/usr/share/games/fs2source/fs2_open/code/weapon/weapons.cpp:249:1: required from here
/usr/share/games/fs2source/fs2_open/code/globalincs/pstypes.h:241:2: warning: declaration of ‘in_use’ shadows a member of ‘special_flag_def_list_new&>’ [-Wshadow]
special_flag_def_list_new(const char* name, T flag, bool in_use) : flag_def_list_new{ name, flag, in_use, false } {}
^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/share/games/fs2source/fs2_open/code/globalincs/pstypes.h:230:10: note: shadowed declaration is here
bool in_use; // Whether or not this flag is currently in use or obsolete
^~~~~~
/usr/share/games/fs2source/fs2_open/code/globalincs/pstypes.h:241:2: warning: declaration of ‘name’ shadows a member of ‘special_flag_def_list_new&>’ [-Wshadow]
special_flag_def_list_new(const char* name, T flag, bool in_use) : flag_def_list_new{ name, flag, in_use, false } {}
^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/share/games/fs2source/fs2_open/code/globalincs/pstypes.h:228:17: note: shadowed declaration is here
const char* name; // The parseable representation of this flag
^~~~
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.