lzip-bug
[Top][All Lists]
Advanced

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

Re: [Lzip-bug] lzlib on Windows


From: Antonio Diaz Diaz
Subject: Re: [Lzip-bug] lzlib on Windows
Date: Mon, 19 Oct 2009 14:05:41 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.11) Gecko/20050905

JonY wrote:
This patch makes lzlib 0.6 build on MSYS/MinGW.

Unfortunately I was unable to get the lzcheck test to pass, it mysteriously segfaults right after entering main(). It happens with mingw, mingw-w64, and msvc2008.

I suppose this is because lzcheck uses a couple big local arrays. Please, try the attaced patch.


btw, I noticed that main() has const parameters, is it intentional?

Yes, to show the fact that main does not modify them.


"make distclean" also does not clean up lzcheck.o.

Fixed, Thanks.
--- ../src/lzcheck.cc~  2009-09-02 13:08:15.000000000 +0200
+++ ../src/lzcheck.cc   2009-09-05 16:36:52.000000000 +0200
@@ -29,6 +29,13 @@
 #define ULLONG_MAX 0xFFFFFFFFFFFFFFFFULL
 #endif
 
+const int in_buffer_size = 1 << 20;
+const int mid_buffer_size = 65536;
+const int out_buffer_size = in_buffer_size;
+uint8_t in_buffer[in_buffer_size];
+uint8_t mid_buffer[mid_buffer_size];
+uint8_t out_buffer[out_buffer_size];
+
 
 int main( const int argc, const char * argv[] )
   {
@@ -45,12 +52,6 @@
     return 1;
     }
 
-  const int in_buffer_size = 1 << 20;
-  const int mid_buffer_size = 65536;
-  const int out_buffer_size = in_buffer_size;
-  uint8_t in_buffer[in_buffer_size];
-  uint8_t mid_buffer[mid_buffer_size];
-  uint8_t out_buffer[out_buffer_size];
   const int in_size = std::fread( in_buffer, 1, in_buffer_size, f );
   if( in_size >= in_buffer_size )
     {

reply via email to

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