comp.lang.ada
 help / color / mirror / Atom feed
From: Martin Krischik <krischik@users.sourceforge.net>
Subject: Re: different compilers: different standard types?????
Date: Wed, 17 Mar 2004 18:10:20 +0100
Date: 2004-03-17T18:10:20+01:00	[thread overview]
Message-ID: <1289218.QGP5jpaqpk@linux1.krischik.com> (raw)
In-Reply-To: c391gu$5c3$1@e3k.asi.ansaldo.it

Riccardo wrote:

> Hello everybody!
> 
> I've got a problem.
> Using an old program that now my Firm wants to make running on different
> kind of consoles simoultaneously I see that my compilers (I have two of
> them) are different ones depending on the fact that the word lenght is
> different (32 vs 64 bit).
> 
> Specifically:  I noticed that the type long_long_integer, that is used on
> the first one, is not present at all on the second one.

Well define your own types. 

> I'm looking for a solution that should permit me to compile the software
> on both the environments making, obviously, the least changes on the
> current version.
> 
> The same product, in the end, should be compiled on both the consoles
> without making changes! (it is possible!?!??!!??!)

If both compilers support the same types: yes.

> Is there someone who has any kind of easy solution for that problem??

I take it you are pretty new to Ada - otherwise you would know the solution.

In Ada you can define your own integer types. i.E.:

type Month is range 1 .. 31;

The compiler will choose the bits needed which is good for most programms.
If you need a special size you can say:

for Month'Size use 8; -- bit!

or even

for Month'Size use 5;

Performace for a 5 bit type will be abysmal but if you want it the compiler
will give it to you.

If you need long_long_integer and the compiler does not provide one use:

type long_long_integer is range -2**63 .. +2**63 - 1;
for long_long_integer'Size use 64;

With Regards

Martin

-- 
mailto://krischik@users.sourceforge.net
http://www.ada.krischik.com




  reply	other threads:[~2004-03-17 17:10 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-17  8:15 different compilers: different standard types????? Riccardo
2004-03-17 17:10 ` Martin Krischik [this message]
2004-03-18  3:47 ` Steve
2004-03-18 10:37   ` Jean-Pierre Rosen
2004-03-18 13:09     ` Dmitry A. Kazakov
2004-03-18 13:13   ` Marius Amado Alves
2004-03-18 14:21     ` Ludovic Brenta
2004-03-18 14:45     ` Georg Bauhaus
2004-03-18 17:33       ` Marius Amado Alves
2004-03-18 17:42       ` Martin Krischik
2004-03-19  0:16     ` Jeffrey Carter
     [not found]   ` <200403181313.16003.maa@liacc.up.pt>
2004-03-18 19:35     ` Duncan Sands
2004-03-19  1:08     ` Stephen Leake
     [not found]     ` <200403182035.57424.baldrick@free.fr>
2004-03-19  8:07       ` Marius Amado Alves
2004-03-19  3:29         ` Steve
2004-03-19 15:36           ` Marius Amado Alves
     [not found]           ` <00a401c40dc7$f2b333e0$c32416d5@netcabo.pt>
2004-03-19 16:03             ` Marius Amado Alves
     [not found]     ` <u7jxhprro.fsf@acm.org>
     [not found]       ` <005f01c40dbf$94ce9e20$c32416d5@netcabo.pt>
2004-03-19 13:19         ` Stephen Leake
2004-03-19 14:36       ` Marius Amado Alves
2004-03-19 10:16         ` Jean-Pierre Rosen
2004-03-20  0:52         ` Jeffrey Carter
2004-03-20 22:56           ` Marius Amado Alves
  -- strict thread matches above, loose matches on Subject: below --
2004-03-19  7:33 Riccardo
2004-03-19 13:10 ` Martin Dowie
replies disabled

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