comp.lang.ada
 help / color / mirror / Atom feed
From: "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com>
Subject: Re: Missing **-operator in GNAT 3.14?
Date: Tue, 2 Apr 2002 05:14:36 -0600
Date: 2002-04-02T05:14:36-06:00	[thread overview]
Message-ID: <mailman.1017746102.31836.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: 3CA97235.974C8641@NO.SPAM.PLEASE.emw.ericsson.se

The renaming declarations are unneccessary because those operators
are implicitly declared for all integer types.

That this is so is evidenced by the successful compilation and
execution of the following program (with the renaming declarations
in Mytest commented out):

with Ada.Text_IO;
with Mypack;
with Mytest;
procedure Main is
   use type Mypack.Short;
   Value : Mypack.Short := 3 ** 4;
   My_Value : Mytest.My_Short := 4 ** 5;
begin
   Ada.Text_IO.Put_Line (Value'Img);
   Ada.Text_IO.Put_Line (My_Value'Img);
end Main;

The fact that "*", and "**" are treated differently by GNAT looks
like a "bug" to me, though, and you should probably report it
to report@gnat.com


----- Original Message -----
From: "Anders R�berg" <anders.raberg@NO.SPAM.PLEASE.emw.ericsson.se>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada.eu.org>
Sent: April 02, 2002 2:56 AM
Subject: Missing **-operator in GNAT 3.14?


> Hi all,
>
> I'm trying to compile a program that contains the follwing code:
>
>
>     --- mypack.ads ---
>
>     1: with Interfaces;
>     2:
>     3: package Mypack is
>     4:   type Short is new Interfaces.Integer_16;
>     5: end Mypack;
>
>     ------------------
>
>
>
>     --- mytest.ads ---
>
>     1: with Mypack;
>     2:
>     3: package Mytest is
>     4:    subtype My_Short is Mypack.Short;
>     5:
>     6:    function "*" (A, B : in My_Short) return My_Short renames
> Mypack."*";
>     7:
>     8:    function "**" (A, B : in My_Short) return My_Short renames
> Mypack."**";
>     9: end Mytest;
>
>     -----------------
>
>     % gcc -c mytest.ads
>     mytest.ads:8:63: operator for type "Short" is not declared in
> "Mypack"
>
>
> When I compile the program with GNAT 3.13, 3.12 etc. it works perfectly
> fine, but when I use 3.14 I get the error stated above. Has the
> **-operator been removed or have I missed something?
>
>
> Regards,
> Anders
>
> --
> ----------------------------------------------------------------------
> Anders R�berg, M.Sc. C.S&E
> Software Systems Engineer
> Ericsson Microwave Systems AB, Sweden
> ----------------------------------------------------------------------
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada
>
>





  reply	other threads:[~2002-04-02 11:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-02  8:56 Missing **-operator in GNAT 3.14? Anders Råberg
2002-04-02 11:14 ` David C. Hoos, Sr. [this message]
2002-04-02 16:18   ` Robert Dewar
2002-04-02 16:42     ` David C. Hoos
2002-04-02 17:11       ` Sergey Koshcheyev
2002-04-03  1:02         ` Robert Dewar
2002-04-03  3:51           ` Steve Doiel
  -- strict thread matches above, loose matches on Subject: below --
2002-04-02 17:07 Robert Dewar
replies disabled

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