* Re: Requesting help with GNAT 3.09 constraint error, PowerPC
[not found] <3468914F.46B4@scarecrow.gcs.redstone.army.mil>
@ 1997-11-12 0:00 ` Robert Dewar
1997-11-12 0:00 ` Dale Pontius
0 siblings, 1 reply; 2+ messages in thread
From: Robert Dewar @ 1997-11-12 0:00 UTC (permalink / raw)
<<I've run into a problem with GNAT 3.09 generating code for the PowerPC.
To make a long debugging session short, I've isolated the problem to
an attempt to typecast a negative floating point number to an unsigned
16.
The following code runs fine on my linux machine when compiled native.
But it gives me a constraint error when I execute it in my PowerPC
environment. Has anyone encountered this? Any suggestions?
Oh yeah, I almost forgot. This only happens with negative numbers.>>
As well it might, unsigned types are somewhat lacking in negative numbers
when you look at the possible values they accomodate!
Your use of the word typecast suggests a C style of thinking, where the
cast is unchecked, most likely what you mean by a typecast in Ada is
a type conversion, and the value must be in range, or you will get a CE.
What is odd here is not the CE, but the fact that you did not expect one!
^ permalink raw reply [flat|nested] 2+ messages in thread