This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/16775] bidmas calculation 64 bit unsigned long long failure
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Jul 2004 02:19:18 -0000
- Subject: [Bug c/16775] bidmas calculation 64 bit unsigned long long failure
- References: <20040727015451.16775.Jesse@amvia.co.nz>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-07-27 02:19 -------
(tp.time * 1000) + tp.millitm + add_ms; //this line has problem.
Since tp.time is long int, (tp.time * 1000) is still only long int, this is where the problem is since this
might and will overflow, using 1000UL or 1000ULL which declares the constant as an unsigned long or
long long which changes the type of the expression to be unsigned long or unsigned long long and the
whole parts too, unlike before when the expression would be still long int.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16775