Ticket #47959

dai_select_tech() clang analyzer warning about garbage value

Eröffnet am: 2023-04-28 05:43 Letztes Update: 2023-05-09 18:00

Auswertung:
Verantwortlicher:
Typ:
Status:
Geschlossen
Komponente:
Meilenstein:
Priorität:
5 - Mittel
Schweregrad:
5 - Mittel
Lösung:
Gefixt
Datei:
2

Details

../../../../src/ai/default/aitech.c:173:26: warning: The left operand of '>' is a garbage value [core.UndefinedBinaryOperatorResult]
      if (goal_values[i] > goal_values[newgoal]

This is likely to be false positive. Analyzer just doesn't know that on each iteration valid_advance_by_number() will filter exactly same techs out, i.e., the same indices are initialized and used.

This ticket is about fixing the clang analyzer warning. There's space for refactoring, but will open separate ticket about that.

Ticket-Verlauf (3/6 Historien)

2023-04-28 05:43 Aktualisiert von: cazfi
  • New Ticket "dai_select_tech() clang analyzer warning about garbage value" created
2023-04-28 05:45 Aktualisiert von: cazfi
Kommentar

Reply To cazfi

There's space for refactoring, but will open separate ticket about that.

-> #47960

2023-05-07 23:06 Aktualisiert von: cazfi
  • Verantwortlicher Update from (Keine) to cazfi
  • Lösung Update from Keine to Accepted
2023-05-09 18:00 Aktualisiert von: cazfi
  • Status Update from Offen to Geschlossen
  • Lösung Update from Accepted to Gefixt

Bearbeiten

Please login to add comment to this ticket » Anmelden