#48841: packets_gen.c equality test on floating point numbers Open Date: 2023-10-13 00:51 Last Update: 2023-10-13 13:56 URL for this Ticket: https://osdn.net//projects/freeciv/ticket/48841 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=48841 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2023-10-13 13:56 Updated by: alienvalkyrie * Component Update from General to Bootstrap Comment: Since this is part of the delta protocol, there is a case for this being a place where exact floating-point comparison is reasonable ~> need to tell the static analysis tools to ignore it here. Alternatively, since in the binary format, we're transmitting these as fixed-point ~> could add appropriate comparison functions to dataio and call into those (though the JSON format's comparison would still need to be exact). We could also not diff float fields at all and save those bits in the header (though we don't currently have a mechanism to exempt only individual fields from delta; would have to add that). --------------------------------------------------------------------- Ticket Status: Reporter: cazfi Owner: (None) Type: Bugs Status: Open Priority: 5 - Medium MileStone: (None) Component: Bootstrap Severity: 5 - Medium Resolution: None --------------------------------------------------------------------- Ticket details: CodeQL about main branch: Equality test on floating-point values common/packets_gen.c:37792 -- 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/48841 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=48841