comp.lang.ada
 help / color / mirror / Atom feed
* a question on basic types of interfaces.C
@ 2006-11-23 12:12 evangeli
  2006-11-23 12:50 ` Jacob Sparre Andersen
  2006-11-24  7:36 ` Martin Krischik
  0 siblings, 2 replies; 3+ messages in thread
From: evangeli @ 2006-11-23 12:12 UTC (permalink / raw)


hello,
there are some points regarding Interfaces.C that I want to be sure of
if I consider Interfaces.C and <limits.h> are the following assertions
always valid :

Interfaces.C.int'first = INT_MIN
Interfaces.C.int'last  = INT_MAX

Interfaces.C.short'first = SHRT_MIN
Interfaces.C.short'last  = SHRT_MAX

Interfaces.C.int'size = sizeof(int) * CHAR_BIT

thanks




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: a question on basic types of interfaces.C
  2006-11-23 12:12 a question on basic types of interfaces.C evangeli
@ 2006-11-23 12:50 ` Jacob Sparre Andersen
  2006-11-24  7:36 ` Martin Krischik
  1 sibling, 0 replies; 3+ messages in thread
From: Jacob Sparre Andersen @ 2006-11-23 12:50 UTC (permalink / raw)


<evangeli@cnam.fr> writes:

> there are some points regarding Interfaces.C that I want to be sure
> of if I consider Interfaces.C and <limits.h> are the following
> assertions always valid :
>
> Interfaces.C.int'first = INT_MIN
> Interfaces.C.int'last  = INT_MAX
>
> Interfaces.C.short'first = SHRT_MIN
> Interfaces.C.short'last  = SHRT_MAX
>
> Interfaces.C.int'size = sizeof(int) * CHAR_BIT

That's certainly how I read "Each of the types declared in
Interfaces.C is C-compatible.".

Greetings,

Jacob
-- 
<URL: small-talk://work/hallway-meeting/...>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: a question on basic types of interfaces.C
  2006-11-23 12:12 a question on basic types of interfaces.C evangeli
  2006-11-23 12:50 ` Jacob Sparre Andersen
@ 2006-11-24  7:36 ` Martin Krischik
  1 sibling, 0 replies; 3+ messages in thread
From: Martin Krischik @ 2006-11-24  7:36 UTC (permalink / raw)


evangeli@cnam.fr schrieb:
> hello,
> there are some points regarding Interfaces.C that I want to be sure of
> if I consider Interfaces.C and <limits.h> are the following assertions
> always valid :
> 
> Interfaces.C.int'first = INT_MIN
> Interfaces.C.int'last  = INT_MAX
> 
> Interfaces.C.short'first = SHRT_MIN
> Interfaces.C.short'last  = SHRT_MAX
> 
> Interfaces.C.int'size = sizeof(int) * CHAR_BIT

If you use compatible compilers: yes. I might be nitpicking but if you 
use a 64 bit GNAT-Ada and try to combine it with 16 bit Watcom-C then 
the assertions won't be true.

32 bit GNAT-Ada and 32 bit Watcom-C do actually work - sort of.

Check the documentation of your Ada compiler for a list a compatible C 
compiler :-).

Martin



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-11-24  7:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-23 12:12 a question on basic types of interfaces.C evangeli
2006-11-23 12:50 ` Jacob Sparre Andersen
2006-11-24  7:36 ` Martin Krischik

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