public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/35567]  New: spurious character in array definition generates gnat error rather than syntax error
@ 2008-03-13 14:39 jwise at draga dot com
  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
  0 siblings, 2 replies; 3+ messages in thread
From: jwise at draga dot com @ 2008-03-13 14:39 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug ada/35567] spurious character in array definition generates gnat error rather than syntax error
  2008-03-13 14:39 [Bug ada/35567] New: spurious character in array definition generates gnat error rather than syntax error jwise at draga dot com
@ 2008-03-13 14:39 ` jwise at draga dot com
  2008-03-13 15:48 ` sam at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: jwise at draga dot com @ 2008-03-13 14:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jwise at draga dot com  2008-03-13 14:39 -------
Full gcc -v output is as follows, by the way:

besaid:~/proj jwise$ /usr/local/ada-4.3/bin/gcc -v
Using built-in specs.
Target: i686-apple-darwin8
Configured with: /Volumes/FireLite/Shared/Developer/Compiler/gcc-head/configure
--disable-checking --disable-nls --enable-static --prefix=/usr/local/ada-4.3
--with-arch=nocona --with-tune=generic --host=i686-apple-darwin8
--target=i686-apple-darwin8 --build=i686-apple-darwin8
--enable-languages=c,ada,objc,obj-c++,c++,fortran
Thread model: posix
gcc version 4.3.0 20070903 (experimental) [trunk revision 128061] (GCC) 
besaid:~/proj jwise$ 


-- 

jwise at draga dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jwise at draga dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35567


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug ada/35567] spurious character in array definition generates gnat error rather than syntax error
  2008-03-13 14:39 [Bug ada/35567] New: spurious character in array definition generates gnat error rather than syntax error jwise at draga dot com
  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
  1 sibling, 0 replies; 3+ messages in thread
From: sam at gcc dot gnu dot org @ 2008-03-13 15:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from sam at gcc dot gnu dot org  2008-03-13 15:47 -------
Confirmed on trunk:

GNAT 4.4.0 20080311 (experimental)
Copyright 1992-2007, Free Software Foundation, Inc.
+===========================GNAT BUG DETECTED==============================+
| 4.4.0 20080311 (experimental) (i686-pc-linux-gnu) Program_Error sem.adb:630
explicit raise|
| Error detected at empire.ads:46:93                                       |

GNAT thinks that there is a missing semicolon before the bogus "I" but doesn't
recover properly from it. Here is a reduced test case:

package T is
  A : Boolean B :=
    True;
end T;

% gcc -c t.ads
+===========================GNAT BUG DETECTED==============================+
| 4.4.0 20080311 (experimental) (i686-pc-linux-gnu) Program_Error sem.adb:630
explicit raise|
| Error detected at t.ads:3:15                                             |


-- 

sam at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sam at gcc dot gnu dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-03-13 15:47:49
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35567


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-03-13 15:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-13 14:39 [Bug ada/35567] New: spurious character in array definition generates gnat error rather than syntax error jwise at draga dot com
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

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).