待辦事項 #48849

gcc-14: city_from_wonder() out-of-bounds array subscript

啟用日期: 2023-10-16 03:50 最後更新: 2023-10-18 00:33

回報者:
負責人:
類型:
狀態:
關閉
元件:
里程碑:
優先權:
5 - 中
嚴重程度:
5 - 中
處理結果:
修正
檔案:
1

細節

gcc-14 development version, S3_1:

../../../src/common/improvement.c: In function 'city_from_wonder':
../../../src/common/improvement.c:874:33: error: array subscript -1 is below array bounds of 'const int[200]' [-Werror=array-bounds=]
  874 |   int city_id = pplayer->wonders[improvement_index(pimprove)];
      |                 ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../../src/common/game.h:35,
                 from ../../../src/common/improvement.c:27:
../../../src/common/player.h:301:7: note: while referencing 'wonders'
  301 |   int wonders[B_LAST];              /* contains city id's, WONDER_NOT_BUILT,

Ticket History (3/4 Histories)

2023-10-16 03:50 Updated by: cazfi
  • New Ticket "gcc-14: city_from_wonder() out-of-bounds array subscript" created
2023-10-16 03:59 Updated by: cazfi
  • 負責人 Update from (無) to cazfi
  • 處理結果 Update from to Accepted
  • 里程碑 Update from (無) to 3.0.9 (closed)
評語

Patch for all branches, including S2_6, attached.

2023-10-18 00:33 Updated by: cazfi
  • 狀態 Update from 開啟 to 關閉
  • 處理結果 Update from Accepted to 修正

編輯

Please login to add comment to this ticket » 登入