emmanuel-marty / lzsa

Byte-aligned, efficient lossless packer that is optimized for fast decompression on 8-bit micros
Other
236 stars 30 forks source link

gcc with C++11 incompatibilities #45

Closed nzeemin closed 4 years ago

nzeemin commented 4 years ago

Marty, many thanks for the LZSA code, I re-used it for my Sav2Cart utility here: https://github.com/nzeemin/ukncbtl-utils/tree/master/Sav2Cartridge

Just FYI, compiling the LZSA code under Ubuntu with gcc, in C++11 mode, I found two small incompatibilities, both are very easy to fix:

  1. lzsa/shrink_block_v2.c:444:28: error: ‘for’ loop initial declarations are only allowed in C99 mode
                            for (int nn = n;
                            ^
    lzsa/shrink_block_v2.c:444:28: note: use option -std=c99 or -std=gnu99 to compile your code
  2. lzsa/matchfinder.c:135:4: error: ‘for’ loop initial declarations are only allowed in C99 mode
    for (int r = 1; r < nInWindowSize; r++) {
    ^
    lzsa/matchfinder.c:135:4: note: use option -std=c99 or -std=gnu99 to compile your code
emmanuel-marty commented 4 years ago

This should be fixed now, thanks for reporting!