This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/28835] Incorrect numeric result in multiplication of user-defined type with universal integer
- From: "S dot Sangwine at IEEE dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Aug 2006 08:39:47 -0000
- Subject: [Bug ada/28835] Incorrect numeric result in multiplication of user-defined type with universal integer
- References: <bug-28835-13140@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from S dot Sangwine at IEEE dot org 2006-08-25 08:39 -------
120 is outside the range of Three, but not outside the range of Three'Base,
which in my case is an 8-bit signed type with range -128 .. 127. So the correct
explanation of the problem is that the multiplication of 2 by 120 yields a
result, 240, which is outside the range of Three'Base, and therefore correctly
raises Constraint_Error if the -gnato switch is given.
However, it is correct to make this report RESOLVED, because the problem is not
a bug in the compiler, but an error in the code, albeit one that goes
undetected by Gnat 'out-of-the-box' without the -gnato switch.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28835