Ticket #44679

sdl2: Clang analyze div by zero warning about popup_goto_airlift_dialog()

Open Date: 2022-05-26 15:45 Last Update: 2022-06-16 15:58

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

Details

Clang analyze gives a div by zero warning about sdl2-client popup_goto_airlift_dialog() line "if (!((i + 1) % col)) {"

Seems to me that it could only happen when number of players allied to the client player (including oneself) is zero. That could happen if the function would ever be called by a global observer, but I don't think it ever happens. So no real bug there - just silencing the warning (and becoming more robust for any future changes where global observer could call the function)

Ticket History (3/5 Histories)

2022-05-26 15:45 Updated by: cazfi
  • New Ticket "sdl2: Clang analyze div by zero warning about popup_goto_airlift_dialog()" created
2022-06-09 07:49 Updated by: cazfi
  • Owner Update from (None) to cazfi
  • Resolution Update from None to Accepted
  • Milestone Update from (None) to 3.0.3 (closed)
2022-06-16 15:58 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