From: Ludovic Brenta <ludovic.brenta@insalien.org>
Subject: Re: how to know sizeof(int)
Date: Wed, 04 Aug 2004 21:06:06 +0200
Date: 2004-08-04T21:06:02+02:00 [thread overview]
Message-ID: <87llguk9k1.fsf@insalien.org> (raw)
In-Reply-To: pivqec.ppo1.ln@skymaster
"Jean-Pierre Rosen" writes:
> "Evangelista Sami" a écrit dans le message de hello
>>
>> how can i know the result of a sizeof(int) (in C).
>> i did not find the approppriate stuffs in interfaces.C.
>>
> Interfaces.C.Int'Size/8
>
> Interfaces.C.Int is the same as C Int, but the Size attributes is in
> bits, not bytes (OK, I assume here that a byte is 8 bits :-).
Indeed, hidden assumptions are evil, and the Enlightened Ones use
System.Storage_Unit instead of just "8". Somehow, "8" is too short to
type and read :)
> Note that sizeof is *not* a regular function (a regular function
> could not have a type as the parameter). It is handled very
> specially in the C compiler, therefore there is no way you could get
> to it from another language.
I suppose 'Size is also handled specially by Ada compilers, right?
--
Ludovic Brenta.
next prev parent reply other threads:[~2004-08-04 19:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-04 14:58 how to know sizeof(int) Evangelista Sami
2004-08-04 15:18 ` Eric Jacoboni
2004-08-04 15:26 ` Adrian Knoth
2004-08-04 15:32 ` Jean-Pierre Rosen
2004-08-04 19:06 ` Ludovic Brenta [this message]
2004-08-05 8:14 ` Jean-Pierre Rosen
2004-08-07 4:09 ` Keith Thompson
2004-08-04 21:52 ` Adrian Knoth
2004-08-05 8:16 ` Jean-Pierre Rosen
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox