this patch is a backport of gcc revision 239971 to gcc 6.3.0. submitted by osvein as PR#35.
bogus use PRIx64 with unsigned long (assumption of 64-bit host) in gcc. older gcc versions are also affected, I think, but not yet fixed.