redjack/libcork — Issue #1: Libcork build generates compiler warning (unused function)
Author: johnzachary
Created: 2012-02-29 15:18:35+00:00
State: open

While building libcork (`make`), the compiler generates a warning of an unused function. The basic conditions are: (1) Mac OS X w/ Xcode 4.3; (2) having removed libcork via `epkg -r libcork`; (3) stock cloned code from Github. This warning was generated in the version of libcork prior to thread-local storage (the warning was moved to another file but it was associated with the same `cork_error_destroy`/`cork_error__tls_destroy` function.

Scanning dependencies of target embedded_libcork
[ 3%] Building C object src/CMakeFiles/embedded_libcork.dir/libcork/core/allocator.c.o
[ 5%] Building C object src/CMakeFiles/embedded_libcork.dir/libcork/core/error.c.o
cc1: warnings being treated as errors
/Users/jzachary/redjack/libcork/src/libcork/core/error.c:46: warning: ‘cork_error__tls_destroy’ defined but not used
make[2]: *** [src/CMakeFiles/embedded_libcork.dir/libcork/core/error.c.o] Error 1
make[1]: *** [src/CMakeFiles/embedded_libcork.dir/all] Error 2
make: *** [all] Error 2

Asking the compiler to ignore this warning will result in a build but 18 out of 22 tests will fail with `make test`.