../../../src/server/sernet.c: In function 'send_ping_times_to_all':
../../../src/server/sernet.c:1471:23: error: array subscript 320 is above array bounds of 'int[320]' [-Werror=array-bounds=]
1471 | packet.conn_id_new[i] = pconn->id;
| ~~~~~~~~~~~~~~~~~~^~~
In file included from ../../../src/common/networking/packets.h:90,
from ../../../src/common/game.h:36,
from ../../../src/server/sernet.c:75:
../../../src/common/packets_gen.h:818:7: note: while referencing 'conn_id_new'
818 | int conn_id_new[MAX_NUM_CONNECTIONS];
| ^~~~~~~~~~~
../../../src/server/sernet.c:1472:23: error: array subscript 320 is above array bounds of 'float[320]' [-Werror=array-bounds=]
1472 | packet.ping_time_6[i] = pconn->ping_time;
| ~~~~~~~~~~~~~~~~~~^~~
../../../src/common/packets_gen.h:820:9: note: while referencing 'ping_time_6'
820 | float ping_time_6[MAX_NUM_CONNECTIONS];
| ^~~~~~~~~~~
cc1: all warnings being treated as errors
We do have an assert checking that there should never be more than MAX_NUM_CONNECTIONS rounds in the iteration, but that doesn't count as "protection" against the case the way the compiler would want.
Seen only in S3_0 (presumably it's the optional capability stuff there causing heuristic to end to different conclusion than in other branches), so patch attached just for that branch.
Building S3_0 with gcc-14 development version:
We do have an assert checking that there should never be more than MAX_NUM_CONNECTIONS rounds in the iteration, but that doesn't count as "protection" against the case the way the compiler would want.