This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug ada/28835] Incorrect numeric result in multiplication of user-defined type with universal integer



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]