comp.lang.ada
 help / color / mirror / Atom feed
* Need GNAT Help !!!!!
@ 1998-08-17  0:00 Samuel G. Williams
  1998-08-18  0:00 ` dennison
  1998-08-18  0:00 ` Frank Ecke
  0 siblings, 2 replies; 6+ messages in thread
From: Samuel G. Williams @ 1998-08-17  0:00 UTC (permalink / raw)


I have been helping a software engineer in another area of out company draft an ADA solution for
an extremely complex problem. Recently we have run into a problem on the processor we have
targeted for the application. Our suspicions are that we may have a type incompatability between
the Sun we are developing on and the x186 that we have targeted.

Does anyone know how to change a type size under GNAT? We have looked at all the files that come
with a typical GNAT distribution and we can't decide which one should be changed!! What we are
in essence looking for is the analog to the standard package, such that we can make a change
that will propagate through to the eventual object.

Our difficulty stems from the fact that there seems to be no good documentation on the actual
flow through the compilation process. If anyone knows the answer to this please let me know.

BTW, we are attempting this with GNAT because it looks good and has good purchased support.
Currently, we have no money to support this initial experiment and are in fact using the success
from this to garner management attention so we can buy the support package from Adacore.

Thanks for all responses...

--

Sam Williams  wb5yni					samw@wwa.com
Systems Programmer Staff Specialist			samw@sinnfree.org
---------------------------------------------------------------------------

	simplicity is the ultimate form of sophistication....
			Leonardo Da Vinci





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

* Re: Need GNAT Help !!!!!
  1998-08-17  0:00 Need GNAT Help !!!!! Samuel G. Williams
@ 1998-08-18  0:00 ` dennison
  1998-08-20  0:00   ` Samuel G. Williams
  1998-08-18  0:00 ` Frank Ecke
  1 sibling, 1 reply; 6+ messages in thread
From: dennison @ 1998-08-18  0:00 UTC (permalink / raw)


In article <6ra6bc$8mv$1@hirame.wwa.com>,
  samw@wwa.com (Samuel G. Williams) wrote:
> I have been helping a software engineer in another area of out company draft
an ADA solution for
> an extremely complex problem. Recently we have run into a problem on the
processor we have
> targeted for the application. Our suspicions are that we may have a type
incompatability between
> the Sun we are developing on and the x186 that we have targeted.

Hmmm. Remember that these two platforms have a different byte-ordering too
(assuming you are using a SPARC-based Sun).

> Does anyone know how to change a type size under GNAT? We have looked at all
the files that come

No need to muck with the compiler internals. You can define your own versions
of all the base types that have the sizes you desire. That is, in fact, what
you *should* be doing if you want your objects to be the same size on multiple
platforms.

That won't of course solve your 'endian problem...


T.E.D.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




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

* Re: Need GNAT Help !!!!!
  1998-08-17  0:00 Need GNAT Help !!!!! Samuel G. Williams
  1998-08-18  0:00 ` dennison
@ 1998-08-18  0:00 ` Frank Ecke
  1 sibling, 0 replies; 6+ messages in thread
From: Frank Ecke @ 1998-08-18  0:00 UTC (permalink / raw)


On 17 Aug 1998 21:12:12 GMT, Samuel G. Williams <samw@wwa.com> wrote:

> I have been helping a software engineer in another area of out company draft
> an ADA solution for an extremely complex problem.

Please, use the name Ada.


>Does anyone know how to change a type size under GNAT?

This is quite vague a question.  If you want to alter the number of bits used
for the representation of the type, then this is not a question specific to
GNAT.  Ada provides for such facilities.  You might wish to take a look at
Section 13 of the Ada Reference Manual.  Following below is a short
demonstration:


   type Short is delta 0.01 range -100.0 .. 100.0;
   for Short'Size use 15;


In essence, the above code requests that 15 bits be used for the representation
of the type (descriptor) and for the objects eventually created (of type
Short).


Is that what you were looking for?  If not, be more precise!


Regards,


Frank




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

* Re: Need GNAT Help !!!!!
  1998-08-18  0:00 ` dennison
@ 1998-08-20  0:00   ` Samuel G. Williams
  1998-08-21  0:00     ` dennison
  0 siblings, 1 reply; 6+ messages in thread
From: Samuel G. Williams @ 1998-08-20  0:00 UTC (permalink / raw)


What we are attempting to do now because of the way in which the code was
written is leave integer as a universal value and change the actual size
of the integer within the gnat environment. I know this sounds hokie, but
the end application is written only for an embedded 80186 and this is a
pilot use of gnat. If this works things will be changed to the more normal
method of creating special data types for our applications. Our problem
should have beeb realized up front, but unfortunately it wasn't. By the
way, this is for a special lab application and not one that will be flying
in the next Boeing release. 

You also mentioned something about the byte ordering differences betwwen
sparc and 80186. do you know of any reference documentation that
illustrates this.

I really appreciate all help and comments I have received. Any additional
will be greatly appreciated.

Sam Williams
sgwilliams@snds.com
samw@wwa.com
samw@sinnfree.org


dennison@telepath.com wrote:
: In article <6ra6bc$8mv$1@hirame.wwa.com>,
:   samw@wwa.com (Samuel G. Williams) wrote:
: > I have been helping a software engineer in another area of out company draft
: an ADA solution for
: > an extremely complex problem. Recently we have run into a problem on the
: processor we have
: > targeted for the application. Our suspicions are that we may have a type
: incompatability between
: > the Sun we are developing on and the x186 that we have targeted.
: 
: Hmmm. Remember that these two platforms have a different byte-ordering too
: (assuming you are using a SPARC-based Sun).
: 
: > Does anyone know how to change a type size under GNAT? We have looked at all
: the files that come
: 
: No need to muck with the compiler internals. You can define your own versions
: of all the base types that have the sizes you desire. That is, in fact, what
: you *should* be doing if you want your objects to be the same size on multiple
: platforms.
: 
: That won't of course solve your 'endian problem...
: 
: 
: T.E.D.
: 
: -----== Posted via Deja News, The Leader in Internet Discussion ==-----
: http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

-- 

Sam Williams  wb5yni					samw@wwa.com
Systems Programmer Staff Specialist			samw@sinnfree.org
---------------------------------------------------------------------------

	simplicity is the ultimate form of sophistication....
			Leonardo Da Vinci





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

* Re: Need GNAT Help !!!!!
  1998-08-20  0:00   ` Samuel G. Williams
@ 1998-08-21  0:00     ` dennison
  0 siblings, 0 replies; 6+ messages in thread
From: dennison @ 1998-08-21  0:00 UTC (permalink / raw)


In article <6ri2b6$g9o$1@hirame.wwa.com>,
  samw@wwa.com (Samuel G. Williams) wrote:
> What we are attempting to do now because of the way in which the code was
> written is leave integer as a universal value and change the actual size
> of the integer within the gnat environment. I know this sounds hokie, but

It sounds like a recipe for disaster. Please reconsider. Even if you go ahead
and try it, I suspect you will eventually realize it would be far easier to
just fix your source code. I'm just trying to save you some time up front.

> You also mentioned something about the byte ordering differences betwwen
> sparc and 80186. do you know of any reference documentation that
> illustrates this.

Well, I'm not sure what you mean by reference documentation. I have attached
the URLs of the FOLDOC entires for big-endian:
http://www.instantweb.com/foldoc/foldoc.cgi?big-endian and little-endian:
http://www.instantweb.com/foldoc/foldoc.cgi?little-endian and NUXI problem:
http://www.instantweb.com/foldoc/foldoc.cgi?NUXI+problem

Note from the above that the SPARC chip is big-endian, and the x86 intel
processors are little-endian. The PowerPC is "bytesexual", but I believe most
OS's make it big-endian.

This is generally only an issue when binary data has to be transferred from
one platform to the other. If you are just converting source code, you
probably won't have a problem.

--
T.E.D.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




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

* Re: Need GNAT Help !!!!!
@ 1998-08-22  0:00 dewar
  0 siblings, 0 replies; 6+ messages in thread
From: dewar @ 1998-08-22  0:00 UTC (permalink / raw)


Samuel seems to want to modify the compiler to change the size of some
object! This is obviously the wrong way to go about things, use the
features of the language to achieve the representation that you need.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




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

end of thread, other threads:[~1998-08-22  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-08-17  0:00 Need GNAT Help !!!!! Samuel G. Williams
1998-08-18  0:00 ` dennison
1998-08-20  0:00   ` Samuel G. Williams
1998-08-21  0:00     ` dennison
1998-08-18  0:00 ` Frank Ecke
  -- strict thread matches above, loose matches on Subject: below --
1998-08-22  0:00 dewar

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