Subject: bug#25663: verify macro in system.h incorrectly expects 8 byte long for 64-bit builds on Windows/Visual Studio

From: Kees Dekker <[email-masked]>
Date: Thu, 9 Feb 2017 13:15:43 +0000

Hi,

The verify macro in system.h:137 (diffutils3.5) fails on Windows.
This line contains the following code:

verify (sizeof (lin) <= sizeof (long int));

Because of a long on Windows remains 32-bit (for Visual Studio), even in 64-bit mode, this compile time assert fails. It is only for *NIX that a long sizes identical to the bit-ness of the build, similar to pointers.
For an integer type that properly sizes with pointers, you need to use intptr_t. See also https://msdn.microsoft.com/nl-nl/library/s3f49ktz.aspx.

I'm not sure how gcc behaves on Windows, but event then intptr_t is probably the better type to use.

If Visual Studio is used, then the _MSCVER macro is set, see also https://msdn.microsoft.com/en-us/library/b0084kay.aspx.

Can you please fix this?

Regards,
Kees