comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Interresting, possibly buggy behavior in GNAT generics w/ expression function.
Date: Mon, 1 Apr 2013 19:46:06 -0500
Date: 2013-04-01T19:46:06-05:00	[thread overview]
Message-ID: <kjd9oi$966$1@munin.nbi.dk> (raw)
In-Reply-To: 65330bfe-39e4-4f7b-85f5-e06e9458bf29@googlegroups.com

"Adam Beneschan" <adam@irvine.com> wrote in message 
news:65330bfe-39e4-4f7b-85f5-e06e9458bf29@googlegroups.com...
On Friday, March 29, 2013 6:04:28 PM UTC-7, Randy Brukardt wrote:

...
>Randy, it looks to me that the original code called Image(...) only from 
>inside the
>generic specification or body, not outside.

OK, I didn't see that, because the OP I got only had a description of the 
spec in it, no code at all.

>I'm sure Randy already knows this, but for the benefit of anyone who 
>doesn't: When
>a call to Image occurs inside the generic spec or body, the meaning of 
>Image (i.e.
>which one is selected) depends only on the stuff the compiler knows when 
>the
>generic is *compiled*; the actual types used in an *instantiation* don't 
>matter,
>for this purpose.  (Yes, I know things might be a bit more complicated when
>dispatching is involved, but that's not an issue here.)  For compilers that 
>use
>"macro expansion" to implement generic instantiations (including GNAT, but 
>not
>Janus/Ada), this poses challenges for the compiler writer, because it 
>doesn't work
>to simply replace Attribute_Values with Integer when recompiling the 
>generic.  This
>looks like a case that fell through the cracks in GNAT.

Right. Calls in the body *always* should treat Attr_Value and 
Natural/Positive as different types; the actuals don't matter. So if 
changing the subtypes is changing the called routines, you have a GNAT bug, 
pure and simple.

                                       Randy.





  reply	other threads:[~2013-04-02  0:46 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-28 17:34 Interresting, possibly buggy behavior in GNAT generics w/ expression function Shark8
2013-03-28 18:06 ` Simon Wright
2013-03-28 18:38   ` Shark8
2013-03-30  5:59     ` Stephen Leake
2013-03-30 14:20       ` Shark8
2013-03-29  7:45 ` Simon Wright
2013-03-29 12:27   ` Dmitry A. Kazakov
2013-03-29 14:45     ` Simon Wright
2013-03-29 16:21       ` Dmitry A. Kazakov
2013-03-29 16:43         ` Shark8
2013-03-29 17:43         ` Eryndlia Mavourneen
2013-03-29 17:45           ` Eryndlia Mavourneen
2013-03-29 18:38             ` Simon Wright
2013-03-30  0:56         ` Randy Brukardt
2013-03-30  9:24           ` Dmitry A. Kazakov
2013-04-02  0:52             ` Randy Brukardt
2013-04-02  8:51               ` Dmitry A. Kazakov
2013-04-02 21:59                 ` Randy Brukardt
2013-03-29 14:47   ` Shark8
2013-03-29 14:56     ` Shark8
2013-03-30  1:04   ` Randy Brukardt
2013-03-30  2:36     ` Shark8
2013-03-30 15:51     ` Simon Wright
2013-04-01 15:58     ` Adam Beneschan
2013-04-02  0:46       ` Randy Brukardt [this message]
2013-04-02  8:18         ` Simon Wright
2013-04-02 11:14         ` Stephen Leake
2013-04-02 22:00           ` Randy Brukardt
2013-04-02 23:01             ` Adam Beneschan
2013-04-04  0:08               ` Randy Brukardt
2013-03-29 14:47 ` Simon Wright
2013-03-29 14:54   ` Shark8
2013-03-29 15:26     ` Bill Findlay
2013-03-29 15:48     ` Simon Wright
replies disabled

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