[Freeciv-tickets] [freeciv] #48265: fit_nationset_to_players() garbage misfits[i] clang analyzer warning

Back to archive index
OSDN Ticket System norep****@osdn*****
Thu Jun 22 12:57:25 JST 2023


#48265: fit_nationset_to_players() garbage misfits[i] clang analyzer warning

  Open Date: 2023-06-21 08:52
Last Update: 2023-06-22 06:57

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

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

Last Changes/Comment on this Ticket:
2023-06-22 06:57 Updated by: cazfi
 * Owner Update from (None) to cazfi
 * Resolution Update from None to Accepted


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

      Reporter: cazfi
         Owner: cazfi
          Type: Bugs
        Status: Open [Owner assigned]
      Priority: 5 - Medium
     MileStone: 3.0.9
     Component: Server
      Severity: 5 - Medium
    Resolution: Accepted
---------------------------------------------------------------------

Ticket details:

Clang analyzer gives a warning about fit_nationset_to_players() (this is from S3_2):
../../../src/server/plrhand.c:2668:23: warning: Assigned value is garbage or undefined [core.uninitialized.Assign]
        least_misfits = misfits[i];
                      ^ ~~~~~~~~~~
Likely the warning is caused just by the fact that there's multiple nation_set_count() calls, and the compiler cannot know that they will always (well, at least the should) return the same value.

-- 
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/48265
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=48265



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