comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Basic questions about wordings in “Interfacing Pragmas”
Date: Tue, 22 Nov 2011 22:05:21 -0800 (PST)
Date: 2011-11-22T22:05:21-08:00	[thread overview]
Message-ID: <2f22a9b7-20ce-4cf5-9010-b13fd2f307b3@q9g2000yqe.googlegroups.com> (raw)
In-Reply-To: op.v5dtvvs4ule2fv@douda-yannick

On Nov 22, 8:39 pm, Yannick Duchêne (Hibou57)
<yannick_duch...@yahoo.fr> wrote:
> Le Tue, 22 Nov 2011 21:07:53 +0100, Adam Beneschan <a...@irvine.com> a
> écrit:
>
> >> In notes at the bottom> 46 5  The local_name in an interfacing pragma
> >> can denote more
> >> > than one entity in the case of overloading. Such a pragma
> >> > applies to all of the denoted entities.
>
> >> Why not the same with types derived from a type with an interfacing
> >> pragma
> >> ?
>
> > Types can't be overloaded.  Since you can declare more than one
> > subprogram with the same name, the purpose of this note is to describe
> > what happens if you use that name in one of these pragmas, in that
> > case.  There's no need for a similar rule about types.
>
> Oops, I was misunderstood here.
>
> Say T11 is tagged type. A pragma specify some convention for T11.
> According to this RM page, then a type T12 extending (or not) T11, will
> hold the same convention too.
>
> Say T21 is a “classic” scalar type. A pragma specify some convention for
> T21. According to this RM page, then a `type T22 is new T21;` will not
> hold the same convention, because it is not denoted by the same same any
> more, and it is not tagged.
>
> I am not feeling fine with this: T12 will keep the convention, while T22
> won't. T22 should too.

Now I'm really confused.  First of all, I already pointed you to the
section that says that T22 *will* keep the convention applied to T21.
Second, I've looked through B.1 twice and can't find any language in
there that applies to tagged types differently from untagged types.
What part of this section made you think that there was a difference?


> Similarly: formally (no compiler specific answer please), what about
> `subtype T23 is T21;`. Not denoted by the same name too, so too not
> warranted to still hold the convention specified for T21 ? If so, this is
> another reason for me to not feeling OK.

Please go back and reread what I wrote about subtypes.  T23 and T21
are the same ***type***.  Whatever Convention pragma applies to T21
also applies to T23 because it's the same type.

                        -- Adam



      reply	other threads:[~2011-11-23  6:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-22 18:15 Basic questions about wordings in “Interfacing Pragmas” Yannick Duchêne (Hibou57)
2011-11-22 18:18 ` Yannick Duchêne (Hibou57)
2011-11-22 19:10 ` AdaMagica
2011-11-23  4:28   ` Yannick Duchêne (Hibou57)
2011-11-22 20:07 ` Adam Beneschan
2011-11-23  4:39   ` Yannick Duchêne (Hibou57)
2011-11-23  6:05     ` Adam Beneschan [this message]
replies disabled

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