Ticket #45985

sdl2: 'count' in popup_diplomatic_objects() unsigned

오픈 날짜: 2022-10-27 10:27 마지막 업데이트: 2022-11-06 00:56

Reporter:
소유자:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
2

Details

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 (None) to cazfi
  • Resolution Update from None 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
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed

Edit

Please login to add comment to this ticket » Login