待辦事項 #45985

sdl2: 'count' in popup_diplomatic_objects() unsigned

啟用日期: 2022-10-27 10:27 最後更新: 2022-11-06 00:56

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

細節

To human eye, 'count' in popup_diplomatic_objects() is clearly always positive (initialized as 0, and ever only increased by 1). Clang analyzer seems to fail realize that, as it gives warning about division by zero that could happen only if 'count < 0' (count must be smaller than the divider). Formally declaring 'count' unsigned makes the warning to go away.

Ticket History (3/5 Histories)

2022-10-27 10:27 Updated by: cazfi
  • New Ticket "sdl2: 'count' in popup_diplomatic_objects() unsigned" created
2022-10-30 04:08 Updated by: cazfi
  • 負責人 Update from (無) to cazfi
  • 處理結果 Update from to Accepted
評語

Attached patches touch a couple of other variables too (size, width and height, related ones)

2022-11-06 00:56 Updated by: cazfi
  • 狀態 Update from 開啟 to 關閉
  • 處理結果 Update from Accepted to 修正

編輯

Please login to add comment to this ticket » 登入