From: Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: C's sizeof
Date: Thu, 12 Apr 2012 13:59:58 -0700
Date: 2012-04-12T13:59:58-07:00 [thread overview]
Message-ID: <jm7fot$n36$1@tornado.tornevall.net> (raw)
In-Reply-To: <11092332.346.1334257093663.JavaMail.geo-discussion-forums@ynhh34>
On 04/12/2012 11:58 AM, Adam Beneschan wrote:
>>
>> type N2 is range 0 .. Integer'Last - 1;
>> pragma Convention (C, N2);
>>
>> and N2'Size is 31 ...
>
> Yeah, you're right. But then I don't think your formula would work either:
>
> type N3 is range 0 .. 2**22 - 1;
> pragma Convention (C, N3);
>
> and N3'Size is 22. But what would the sizeof() of the C type be?
Technically, these are subtypes. C doesn't have subtypes. The C types are
N1'Base and N2'Base, which are both 32 bits.
--
Jeff Carter
"I was hobbling along, minding my own business, all of a
sudden, up he comes, cures me! One minute I'm a leper with
a trade, next minute my livelihood's gone! Not so much as a
'by your leave!' You're cured, mate. Bloody do-gooder!"
Monty Python's Life of Brian
76
next prev parent reply other threads:[~2012-04-12 21:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-12 16:27 C's sizeof Simon Wright
2012-04-12 16:43 ` Adam Beneschan
2012-04-12 18:42 ` Simon Wright
2012-04-12 18:58 ` Adam Beneschan
2012-04-12 20:29 ` Simon Wright
2012-04-12 20:59 ` Jeffrey Carter [this message]
2012-04-12 22:24 ` Robert A Duff
2012-04-13 5:57 ` 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