public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jwise at draga dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/35567] New: spurious character in array definition generates gnat error rather than syntax error Date: Thu, 13 Mar 2008 14:39:00 -0000 [thread overview] Message-ID: <bug-35567-15909@http.gcc.gnu.org/bugzilla/> (raw) 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
next reply other threads:[~2008-03-13 14:39 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2008-03-13 14:39 jwise at draga dot com [this message] 2008-03-13 14:39 ` [Bug ada/35567] " jwise at draga dot com 2008-03-13 15:48 ` sam at gcc dot gnu dot org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-35567-15909@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).