mutability / dump1090

Dump1090 is a simple Mode S decoder for RTLSDR devices
528 stars 137 forks source link

Remove unused functions in demod_2400 #125

Closed rxseger closed 8 years ago

rxseger commented 8 years ago

Attempting to compile on OS X 10.11.5 (with librtlsdr installed via Homebrew) fails due to unused functions:

dump1090 $ make
gcc -DMODES_DUMP1090_VERSION=\"v1.15-dev-189-gbf04264\" -O2 -g -Wall -Werror -W -std=c11 -DMISSING_GETTIME -DMISSING_NANOSLEEP `pkg-config --cflags librtlsdr`  -c dump1090.c -o dump1090.o
gcc -DMODES_DUMP1090_VERSION=\"v1.15-dev-189-gbf04264\" -O2 -g -Wall -Werror -W -std=c11 -DMISSING_GETTIME -DMISSING_NANOSLEEP  -c anet.c -o anet.o
gcc -DMODES_DUMP1090_VERSION=\"v1.15-dev-189-gbf04264\" -O2 -g -Wall -Werror -W -std=c11 -DMISSING_GETTIME -DMISSING_NANOSLEEP  -c interactive.c -o interactive.o
gcc -DMODES_DUMP1090_VERSION=\"v1.15-dev-189-gbf04264\" -O2 -g -Wall -Werror -W -std=c11 -DMISSING_GETTIME -DMISSING_NANOSLEEP  -c mode_ac.c -o mode_ac.o
gcc -DMODES_DUMP1090_VERSION=\"v1.15-dev-189-gbf04264\" -O2 -g -Wall -Werror -W -std=c11 -DMISSING_GETTIME -DMISSING_NANOSLEEP  -c mode_s.c -o mode_s.o
gcc -DMODES_DUMP1090_VERSION=\"v1.15-dev-189-gbf04264\" -O2 -g -Wall -Werror -W -std=c11 -DMISSING_GETTIME -DMISSING_NANOSLEEP  -c net_io.c -o net_io.o
gcc -DMODES_DUMP1090_VERSION=\"v1.15-dev-189-gbf04264\" -O2 -g -Wall -Werror -W -std=c11 -DMISSING_GETTIME -DMISSING_NANOSLEEP  -c crc.c -o crc.o
gcc -DMODES_DUMP1090_VERSION=\"v1.15-dev-189-gbf04264\" -O2 -g -Wall -Werror -W -std=c11 -DMISSING_GETTIME -DMISSING_NANOSLEEP  -c demod_2400.c -o demod_2400.o
demod_2400.c:76:19: error: unused function 'correlate_check_0' [-Werror,-Wunused-function]
static inline int correlate_check_0(uint16_t *m) {
                  ^
demod_2400.c:85:19: error: unused function 'correlate_check_1' [-Werror,-Wunused-function]
static inline int correlate_check_1(uint16_t *m) {
                  ^
demod_2400.c:94:19: error: unused function 'correlate_check_2' [-Werror,-Wunused-function]
static inline int correlate_check_2(uint16_t *m) {
                  ^
demod_2400.c:103:19: error: unused function 'correlate_check_3' [-Werror,-Wunused-function]
static inline int correlate_check_3(uint16_t *m) {
                  ^
demod_2400.c:112:19: error: unused function 'correlate_check_4' [-Werror,-Wunused-function]
static inline int correlate_check_4(uint16_t *m) {
                  ^
5 errors generated.
make: *** [demod_2400.o] Error 1

Not sure if you want to keep these functions around? But if I remove them (as in this PR), the compilation succeeds.

mutability commented 8 years ago

Can you take a look at why the travis OSX build didn't complain about this? I rely on travis to test on OSX as I don't have an OSX environment myself.

rxseger commented 8 years ago

Looks like the Travis build is using an old version:

https://travis-ci.org/mutability/dump1090/jobs/135817544

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix

https://en.wikipedia.org/wiki/Darwin_(operating_system)#Release_history Darwin 13.4.0 = September 17, 2014 OS X v10.9.5

versus the latest:

~ $ xcodebuild -version
Xcode 7.3.1
Build version 7D1014
~ $ clang -v
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
~ $ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.11.5
BuildVersion:   15F34

https://docs.travis-ci.com/user/osx-ci-environment/#OS-X-Version

Travis CI uses OS X 10.9.5 (and Xcode 6.1) by default . You can use another version of OS X (and Xcode) by specifying the corresponding osx_image key

will investigate. We may want to continue testing on older versions to ensure they don't break; multiple OS X images: http://stackoverflow.com/questions/36710744/how-to-include-multiple-os-x-images-in-travis-yml