comp.lang.ada
 help / color / mirror / Atom feed
From: Anh Vo <anhvofrcaus@gmail.com>
Subject: Re: Bus error
Date: Wed, 27 Jun 2007 20:02:25 -0000
Date: 2007-06-27T20:02:25+00:00	[thread overview]
Message-ID: <1182974545.047564.236590@z28g2000prd.googlegroups.com> (raw)
In-Reply-To: <1182954233.788124.17920@c77g2000hse.googlegroups.com>

On Jun 27, 7:23 am, Maciej Sobczak <see.my.homep...@gmail.com> wrote:
> I have found a problem with my compiler:
>
> -- a.ads
> with Ada.Finalization;
> package A is
>
>    type T is tagged limited private;
>
>    function Make return T;
>
> private
>
>    type T is new Ada.Finalization.Limited_Controlled with
>       record
>          X : Integer;
>       end record;
>
>    overriding procedure Finalize(V : in out T);
>
> end A;
>
> -- a.adb
> with Ada.Text_IO;
> package body A is
>
>    function Make return T is
>    begin
>       return (Ada.Finalization.Limited_Controlled with 7);
>    end Make;
>
>    procedure Finalize(V : in out T) is
>    begin
>       Ada.Text_IO.Put("Finalizing T");
>    end;
>
> end A;
>
> -- hello.adb
> with A;
> procedure Hello is
>    Y : A.T := A.Make;
> begin
>    null;
> end Hello;
>
> $ gnatmake hello
> gcc -c hello.adb
> gcc -c a.adb
> gnatbind -x hello.ali
> gnatlink hello.ali
> $ ./hello
> Bus error
> $
>
> GNAT version: 4.3.0 20070527 (experimental)
>
> BTW - is the code correct at all? I'm worried about A.Make in
> particular.
>
> --
> Maciej Sobczakhttp://www.msobczak.com/

With the lattest snapshot gcc-4.3-20070622 a bug box resulted as shown
below

bash-2.05b$ gnatmake hello.adb
gcc -c hello.adb
gcc -c a.adb
+===========================GNAT BUG
DETECTED==============================+
| 4.3.0 20070615 (experimental) (i686-pc-linux-gnu) Assert_Failure
namet.adb:687|
| Error detected at a.adb:
10:7                                             |
| 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.

a.adb
a.ads

compilation abandoned
gnatmake: "a.adb" compilation error

When compiled with GNAT-GPL-2007, an error is detected

gcc -c hello.adb
gcc -c a.adb
a.adb:10:07: "" is undefined
a.adb:10:07: actual for "From" must be a variable
gnatmake: "a.adb" compilation error

However, if the return statement is fully qualified as below, it works
fine on all versions

$$$       return T'(Ada.Finalization.Limited_Controlled with 7);

AV




  parent reply	other threads:[~2007-06-27 20:02 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-27 14:23 Bus error Maciej Sobczak
2007-06-27 15:45 ` Georg Bauhaus
2007-06-27 17:19   ` Maciej Sobczak
2007-06-28  1:58     ` Robert A Duff
2007-06-28 20:06       ` Maciej Sobczak
2007-06-28 21:19         ` Robert A Duff
2007-06-29  8:05           ` Maciej Sobczak
2007-06-29  9:42             ` Georg Bauhaus
2007-06-29 16:59               ` Adam Beneschan
2007-06-30 12:33                 ` Georg Bauhaus
2007-06-30  2:02             ` Robert A Duff
2007-06-29  8:04         ` Dmitry A. Kazakov
2007-06-29  9:23           ` AW: " Grein, Christoph (Fa. ESG)
2007-06-29 10:17             ` Dmitry A. Kazakov
2007-06-27 20:02 ` Anh Vo [this message]
2007-06-27 20:48   ` Maciej Sobczak
2007-06-28  2:01     ` Robert A Duff
     [not found] <0367891DA5DA7E408D42A860FA002F44B0CC48@sma2901.cr.eurocopter.corp>
2007-06-29  9:35 ` AW: " Duncan Sands
2007-06-29 12:55   ` Dmitry A. Kazakov
2007-06-29 15:37     ` Markus E Leypold
2007-06-29 15:44     ` Georg Bauhaus
2007-06-29 20:07       ` Dmitry A. Kazakov
2007-06-30  1:37         ` Robert A Duff
2007-06-30  8:44           ` Dmitry A. Kazakov
2007-06-30 11:52             ` Georg Bauhaus
2007-06-30 13:16               ` Georg Bauhaus
2007-06-30 14:31               ` Dmitry A. Kazakov
2007-06-30 18:07                 ` Georg Bauhaus
2007-06-30 19:31                   ` Robert A Duff
2007-07-01  9:07                   ` Dmitry A. Kazakov
2007-06-30 15:40               ` Robert A Duff
2007-06-30 17:54                 ` Georg Bauhaus
2007-07-02  8:01           ` Jean-Pierre Rosen
2007-07-02 12:00             ` Dmitry A. Kazakov
2007-07-02 12:30               ` Jean-Pierre Rosen
2007-07-02 14:22             ` Robert A Duff
2007-06-30 13:14         ` Georg Bauhaus
2007-06-30 14:31           ` Dmitry A. Kazakov
2007-06-30 15:34             ` Robert A Duff
2007-07-01  8:34               ` Dmitry A. Kazakov
2007-07-01 15:39                 ` Robert A Duff
2007-07-01 19:41                   ` Dmitry A. Kazakov
2007-06-30 15:29           ` Robert A Duff
2007-06-30 17:41             ` Georg Bauhaus
2007-06-30 13:31         ` Markus E Leypold
2007-07-02  0:16           ` Robert A Duff
  -- strict thread matches above, loose matches on Subject: below --
1990-08-27 23:48 BUS ERROR J o s e D u a r t e ! ! !
1990-08-16 14:52 saharbaugh%roo.dnet
1990-08-13 21:11 J o s e D u a r t e !!!
1990-08-10 12:32 bus error saharbaugh%roo.dnet
1990-08-09 14:50 saharbaugh%roo.dnet
1990-08-10 21:38 ` Chuck Peterson
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox