[Freeciv-tickets] [freeciv] #44679: sdl2: Clang analyze div by zero warning about popup_goto_airlift_dialog()

Back to archive index
OSDN Ticket System norep****@osdn*****
Thu May 26 15:45:00 JST 2022


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

  Open Date: 2022-05-26 09:45
Last Update: 2022-05-26 09:45

URL for this Ticket:
    https://osdn.net//projects/freeciv/ticket/44679
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=44679

---------------------------------------------------------------------

Last Changes/Comment on this Ticket:
2022-05-26 09:45 Updated by: cazfi
 * New Ticket "sdl2: Clang analyze div by zero warning about popup_goto_airlift_dialog()" created


---------------------------------------------------------------------
Ticket Status:

      Reporter: cazfi
         Owner: (None)
          Type: Bugs
        Status: Open
      Priority: 5 - Medium
     MileStone: (None)
     Component: SDL2-client
      Severity: 5 - Medium
    Resolution: None
---------------------------------------------------------------------

Ticket 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 information of Freeciv project
Freeciv Project is hosted on OSDN

Project URL: https://osdn.net/projects/freeciv/
OSDN: https://osdn.net

URL for this Ticket:
    https://osdn.net/projects/freeciv/ticket/44679
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=44679



More information about the Freeciv-tickets mailing list
Back to archive index