comp.lang.ada
 help / color / mirror / Atom feed
* GNAT bug?
@ 2006-10-27  7:57 Maciej Sobczak
  2006-10-27  9:03 ` Stephen Leake
  0 siblings, 1 reply; 16+ messages in thread
From: Maciej Sobczak @ 2006-10-27  7:57 UTC (permalink / raw)


Hi,

Consider this example code:

procedure Protected_Test is

    protected type P is
       entry E;
    end P;

    protected body P is
       entry E when True is
       begin
          null;
       end E;
    end P;

    Pr : P;

begin
    Pr.E;
end Protected_Test; :

and then:

$ gnatmake -gnatv -gnatwd protected_test

GNAT GPL 2005 (20050729)
Copyright 1992-2005 Free Software Foundation, Inc.

Compiling: protected_test.adb (source file time stamp: 2006-10-26 21:53:50)

      8.       entry E when True is
               |
         >>> warning: implicit dereference

  18 lines: No errors, 1 warning
gnatbind -x protected_test.ali
gnatlink protected_test.ali


The -gnatwd option is used to warn against implicit .all when access 
variable is used to access record components and has nothing to do with 
protected objects. Removing one of the options is enough to make the 
compiler happy with the entry keyword, but then the protection against 
implicit .all is lost.

Is it a bug or a feature?

-- 
Maciej Sobczak : http://www.msobczak.com/
Programming    : http://www.msobczak.com/prog/



^ permalink raw reply	[flat|nested] 16+ messages in thread
* Re: GNAT bug?
@ 2006-10-27 20:39 Anh Vo
  0 siblings, 0 replies; 16+ messages in thread
From: Anh Vo @ 2006-10-27 20:39 UTC (permalink / raw)
  To: comp.lang.ada

<< >>> "(see below)" <yaldnif.w@blueyonder.co.uk> 10/27/2006 11:30 AM
>>>
On 27/10/06 18:25, in article 15502511.igE44K045W@linux1.krischik.com,
"Martin Krischik" <krischik@users.sourceforge.net> wrote:

> Stephen Leake wrote:
> 
>> Maciej Sobczak <no.spam@no.spam.com> writes:
>> 
>>> GNAT GPL 2005 (20050729)
>> 
>> Try GNAT GPL 2006
> 
> Won't help. The problem has been there ever since I use GNAT and in
every
> version I know of (I am an -Wall,-W4,-Wwhatever junky - I know).

On MacOS X 10.4.8:

$gnatmake -gnatv -gnatwd protected_test
gcc -c -gnatv -gnatwd protected_test.adb

GNAT GPL 2006 (20060522-34)
Copyright 1992-2006, Free Software Foundation, Inc.

Compiling: protected_test.adb (source file time stamp: 2006-10-27
18:23:48)
 18 lines: No errors
gnatbind -x protected_test.ali
gnatlink protected_test.ali

$ ls
protected_test          protected_test.o
Protected_Test.adb      protected_test.ali

$ ./protected_test 
$ >>

On my PC running Win 2k, it works fine also. See the output below.

E:\Ada\Ada_Discussion\Is_It_A_Bug>gnatmake -gnatv -gnatwd
protected_test
gcc -c -gnatv -gnatwd protected_test.adb

GNAT GPL 2006 (20060522-34)
Copyright 1992-2006, Free Software Foundation, Inc.

Compiling: protected_test.adb (source file time stamp: 2006-10-27
20:31:28)
 19 lines: No errors
gnatbind -x protected_test.ali
gnatlink protected_test.ali

E:\Ada\Ada_Discussion\Is_It_A_Bug>protected_test.exe

E:\Ada\Ada_Discussion\Is_It_A_Bug>




^ permalink raw reply	[flat|nested] 16+ messages in thread
* GNAT bug?
@ 1999-02-09  0:00 Juergen.Hoyng
  1999-02-09  0:00 ` Stephen Leake
  1999-02-10  0:00 ` Pascal Obry
  0 siblings, 2 replies; 16+ messages in thread
From: Juergen.Hoyng @ 1999-02-09  0:00 UTC (permalink / raw)


Hello!

The followings compilation units can be compiled with the Ada83 compiler VADS
6.2.3(c) (Solaris 2.5.1) and Alsys 5.5.4 (HP_UX 10.20).

generic
    type Item      is private;
package Foo is
    type Foo_Type (Kind: Positive) is limited private;
    procedure Foo_Op (Target : in out Foo_Type;
                      Source : in      Foo_Type);
private
   type Foo_Type (Kind: Positive) is
   record
     Blah_Bah : Integer;
    end record;
end Foo;

with Foo;
package X is
   package My_Foo is new Foo(Integer);
   type My_Foo_Type is new My_Foo.Foo_Type;
   procedure Test (X : in out My_Foo_Type;
                   Y : in     My_Foo_Type);
end X;

with Foo;
package body X is
   procedure Test (X : in out My_Foo_Type;
                   Y : in     My_Foo_Type) is
   begin
      Foo_Op (X,Y);  --    <-------- ?????
   end Test;
end X;

When trying to compile these compilation units with gnat-3.11p (Solaris 2.5.1)
I got the error message:
x.adb:6:15: expected private type "My_Foo_Type" defined at x.ads:4
x.adb:6:15: found type "My_Foo_Type" defined at x.ads:4

Is this an Ada95/Ada83 incompatibility or a GNAT bug?


Thanks in advance


Juergen



Juergen Hoyng,  RIO 62             |   email : Juergen.Hoyng@ri.dasa.de
DaimlerChrysler Aerospace AG	   |   fax   : +49 421 539 4529
Raumfahrt Infrastruktur            |
Postfach 286156                    |   voice : +49 421 539 5348
D-28361 Bremen                     |
Germany

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




^ permalink raw reply	[flat|nested] 16+ messages in thread
* GNAT bug?
@ 1998-02-27  0:00 Haug Buerger
  1998-02-28  0:00 ` Jerry van Dijk
  0 siblings, 1 reply; 16+ messages in thread
From: Haug Buerger @ 1998-02-27  0:00 UTC (permalink / raw)



Hi,

i need some help to find out if my program has a fault
or i'm to dump.

I have a generic package with a unconstrained array and
a pointer to it. I can allocate memory with new type(0..x).
If i try to access pointer.all(0) i get a constraint error.

What makes me wonder is that i can allocate with
new type(-1..x) without warning, the array is of "natural
range <>".

The second thing that makes me wonder is that the code
works outside of the generic. I get a warning there if
i try -1..x.

If somebody is willing to compile this very short code with
another compiler and tell me the result i can clear this
point and make a senseful bugreport if necessary.

Haug

For email use haug@zesi.ruhr.de !







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

end of thread, other threads:[~2006-10-27 20:39 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-27  7:57 GNAT bug? Maciej Sobczak
2006-10-27  9:03 ` Stephen Leake
2006-10-27 17:25   ` Martin Krischik
2006-10-27 18:21     ` Pascal Obry
2006-10-27 18:30     ` (see below)
  -- strict thread matches above, loose matches on Subject: below --
2006-10-27 20:39 Anh Vo
1999-02-09  0:00 Juergen.Hoyng
1999-02-09  0:00 ` Stephen Leake
1999-02-10  0:00   ` Pascal Obry
1999-02-10  0:00     ` Tucker Taft
1999-02-11  0:00   ` Juergen.Hoyng
1999-02-10  0:00 ` Pascal Obry
1999-02-10  0:00   ` Tucker Taft
1999-02-11  0:00     ` Pascal Obry
1998-02-27  0:00 Haug Buerger
1998-02-28  0:00 ` Jerry van Dijk

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