bug-diffutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-diffutils] bug#25663: bug#25663: verify macro in system.h incorrect


From: Kees Dekker
Subject: [bug-diffutils] bug#25663: bug#25663: verify macro in system.h incorrectly expects 8 byte long for 64-bit builds on Windows/Visual Studio
Date: Mon, 13 Feb 2017 06:44:14 +0000

Hi Paul,

>> Line numbers beyond 2^32 are also IMO hypothetical...

>It's 2**31, and we don't want arbitrary limits like that in GNU code. It's 
>easy 
>to generate line numbers larger than that nowadays. Here's a contrived example:

>$ rm -f big
>$ truncate --size 10TiB big
>$ echo x >>big
>$ ls -l big
>-rw-r--r--. 1 eggert eggert 10995116277762 Feb 12 00:38 big
>$ grep -zn x big
>10995116277761:x

I made a mistake for the limits, you are right.

>Although diff is not nearly as good as grep with large files (that 'grep' 
>command consumes only 4 ms real time on my old office desktop), diff shouldn't 
>purposely have problems in that area.

>You should be able to avoid the problem by compiling with Cygwin.

As explained before, Cygwin is not an option for us. All of our other binaries 
are native visual studio. We cannot force our customers to install Cygwin, just 
to get diff...

The code will also work (both Cygwin and Windows) if you use long long. Or even 
better, use the standardized types (int64).

And the provided example is IMO still hypothetical. If something is find a file 
by using grep, there is no editor capable in opening such large files. But this 
is a little bit off topic for this discussion.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]