On 2020-09-11 10:32:06 +0000, Kyryl Melekhin wrote: > I guess I'll explain the bug here as well. > consider this code: > > float a = -123.987; > printf("%lu", (unsigned long int)a); > > Before the patch output would be 123. > After the patch output would be 18446744073709551493.
There's no bug. That's undefined behavior (see ISO C17, 6.3.1.4) because -123 is not representable in unsigned long int. So, any behavior is correct. -- Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel