powturbo / TurboBench

Compression Benchmark
326 stars 34 forks source link

Update BriefLZ to 1.2.0 #12

Closed jibsen closed 5 years ago

jibsen commented 5 years ago

This updates the BriefLZ plugin to 1.2.0.

Also fixes an interesting error with non-void functions not returning anything. This is undefined behavior, and it turned out GCC used that to produce buggy code. The makefile used -w which disabled any warnings about it. Specifically, the test for workmemsize at the end of codini() always resulted in an error no matter what the size was.

A little example (just because it's so absurd):

#include <stdio.h>
#include <stdlib.h>

int foo(int argc) {
  if (argc > 4) {
    printf("In C++, %d > 4 .. wat?", argc);
    exit(0);
  }
}

int main(int argc, char *argv[]) {
  foo(argc);
}
$ g++ -w -O3 wat.cpp
$ ./a.out
In C++, 1 > 4 .. wat?
powturbo commented 5 years ago

I've made the changes manually as I had a modified local copy. Thank you for your contribution.

jibsen commented 5 years ago

Great, thanks.