Category : integer-overflow

From updating clang to 10 this code now gives implicit conversion warnings. This is for parsing JSON and since JSON works with JavaScript, and JavaScript has loose conversion rules I’m not sure how to deal with the overflow properly. Is this a situation where I want to disable the warning, or should I make the ..

Read more

FormatDateTime – Integer arithmetic overflow C++ I’m using a C++ builder function which allows me to format a time received from my microcontroller as below: void DisplayTime(unsigned long SecondsSince1900, unsigned short FractionOfSecond, AnsiString* DecodedString) { TDateTime WindowsDate; double FloatingDate; FloatingDate = SecondsSince1900 + (FractionOfSecond / 65536.0); if ( (SecondsSince1900 & 0x80000000) == 0 ) {// ..

Read more