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 c/16775] bidmas calculation 64 bit unsigned long long failure


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


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