[Freeciv-tickets] [freeciv] #48849: gcc-14: city_from_wonder() out-of-bounds array subscript

Back to archive index
OSDN Ticket System norep****@osdn*****
Mon Oct 16 03:50:49 JST 2023


#48849: gcc-14: city_from_wonder() out-of-bounds array subscript

  Open Date: 2023-10-15 21:50
Last Update: 2023-10-15 21:50

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

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

Last Changes/Comment on this Ticket:
2023-10-15 21:50 Updated by: cazfi
 * New Ticket "gcc-14: city_from_wonder() out-of-bounds array subscript" created


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

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

Ticket details:

gcc-14 development version, S3_1:
../../../src/common/improvement.c: In function 'city_from_wonder':
../../../src/common/improvement.c:874:33: error: array subscript -1 is below array bounds of 'const int[200]' [-Werror=array-bounds=]
  874 |   int city_id = pplayer->wonders[improvement_index(pimprove)];
      |                 ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../../src/common/game.h:35,
                 from ../../../src/common/improvement.c:27:
../../../src/common/player.h:301:7: note: while referencing 'wonders'
  301 |   int wonders[B_LAST];              /* contains city id's, WONDER_NOT_BUILT,


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



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