[PATCH] Fix 32-bit overflow in Divesoft Freedom time handling

Thiago Macieira thiago at macieira.org
Sat Oct 3 06:08:48 PDT 2015


On Saturday 03 October 2015 09:38:10 Anton Lundin wrote:
> The root bug was mine. Another one of C's wonderful things that i didn't
> know about.

Yeah...

	unsigned short us = 0xffff;
	unsigned u = 0xffff;

	us * us;		// this is undefined behaviour
	u * u;		// this is fine

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358



More information about the subsurface mailing list