Given the following source file (excuse the ada style -- this is reduced to just the error-causing but of a much longer source file in an ongoing translation of a long-standing C program to Ada), the compiler generates the compiler error shown below. Removing the spurious 'I' in the array definition causes the file to compile cleanly.
========================= begin 'empire.ads' ========================= package Empire is type Direction_T is (NORTH, NORTHEAST, EAST, SOUTHEAST, SOUTH, SOUTHWEST, WEST, NORTHWEST, NODIRECTION); -- in original, function_t was overloaded, with negative values meaning as indicated -- below, and positive values indicatign a location_t destination. -- we now use MOVE_TO_DEST, and the piece_info_t's (new) `Dest' field. -- -- also, despite defined values, the original computer move implementation (compmove.c) -- used two values, '0' and '1' (only), giving them the meaning 'LOADING' and 'UNLOADING'. -- for now, we include these in the type. -- -- XXX XXX better would be to make Piece_Info_T a variant record, where `Func' took on -- a new User_Function_T or Comp_Function_T depending on Owner type Function_T is (NOFUNC, -- no programmed function (-1) RANDOM, -- move randomly (-2) SENTRY, -- sleep (-3) FILL, -- load transport (-4) LAND, -- land fighter at city (-5) EXPLORE, -- explore (-6) ARMYATTACK, -- army looks for city to attack (-8) REPAIR, -- ship moves toward port (-10) WFTRANSPORT, -- army boards a transport (-11) MOVE_N, -- move north (-12) MOVE_NE, -- move northeast (-13) MOVE_E, -- move east (-14) MOVE_SE, -- move southeast (-15) MOVE_S, -- move south (-16) MOVE_SW, -- move southwest (-17) MOVE_W, -- move west (-18) MOVE_NW, -- move northwest (-19) MOVE_TO_DEST, -- move to Obj.Dest COMP_LOADING, -- Comp_Move only COMP_UNLOADING); -- Comp_Move only Move_Dir_Functions : constant array (Direction_T range NORTH .. NORTHWEST) of Function_T I:= ( NORTH => MOVE_N, NORTHEAST => MOVE_NE, EAST => MOVE_E, SOUTHEAST => MOVE_SE, SOUTH => MOVE_S, SOUTHWEST => MOVE_SW, WEST => MOVE_W, NORTHWEST => MOVE_NW ); end Empire; ========================= end 'empire.ads' ========================= ========================= begin gnat error ========================= besaid:~/proj jwise$ /usr/local/ada-4.3/bin/gcc -c empire.ads +===========================GNAT BUG DETECTED==============================+ | 4.3.0 20070903 (experimental) [trunk revision 128061] (i686-apple-darwin8) | | Program_Error sem.adb:630 explicit raise | | Error detected at empire.ads:46:93 | | Please submit a bug report; see http://gcc.gnu.org/bugs.html. | | Use a subject line meaningful to you and us to track the bug. | | Include the entire contents of this bug box in the report. | | Include the exact gcc or gnatmake command that you entered. | | Also include sources listed below in gnatchop format | | (concatenated together with no headers between files). | +==========================================================================+ Please include these source files with error report Note that list may not be accurate in some cases, so please double check that the problem can still be reproduced with the set of files listed. list may be incomplete raised SYSTEM.ASSERTIONS.ASSERT_FAILURE : namet.adb:618 besaid:~/proj jwise$ ========================= end gnat error ========================= -- Summary: spurious character in array definition generates gnat error rather than syntax error Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: minor Priority: P3 Component: ada AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jwise at draga dot com GCC build triplet: i686-apple-darwin8 GCC host triplet: i686-apple-darwin8 GCC target triplet: i686-apple-darwin8 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35567