jmckaskill / luaffi

Standalone FFI library for calling C functions from lua. Compatible with the luajit FFI interface.
469 stars 84 forks source link

ffi.c:164:3: error: variable ‘imag’ set but not used [-Werror=unused-but-set-variable] #8

Closed daurnimator closed 12 years ago

daurnimator commented 12 years ago

The problem appears to be your TO_NUMBER macro along with using Werror

Compile log:

$ make if [ uname = "Darwin" ]; then make macosx; else make posix; fi make[1]: Entering directory /home/daurnimator/src/luaffi' ../lua-5.2.0/src/lua dynasm/dynasm.lua -LN -o call_x86.h call_x86.dasc ../lua-5.2.0/src/lua dynasm/dynasm.lua -D X64 -LN -o call_x64.h call_x86.dasc ../lua-5.2.0/src/lua dynasm/dynasm.lua -D X64 -D X64WIN -LN -o call_x64win.h call_x86.dasc cc -O2 -fPIC -g -Wall -Werror -fvisibility=hidden -Wno-unused-function --std=gnu99 -o ffi.o -c ffi.c ffi.c: In function ‘check_int32’: ffi.c:164:3: error: variable ‘imag’ set but not used [-Werror=unused-but-set-variable] ffi.c: In function ‘check_uint32’: ffi.c:167:3: error: variable ‘imag’ set but not used [-Werror=unused-but-set-variable] ffi.c: In function ‘check_int64’: ffi.c:170:3: error: variable ‘imag’ set but not used [-Werror=unused-but-set-variable] ffi.c: In function ‘check_uint64’: ffi.c:173:3: error: variable ‘imag’ set but not used [-Werror=unused-but-set-variable] ffi.c: In function ‘check_double’: ffi.c:176:3: error: variable ‘imag’ set but not used [-Werror=unused-but-set-variable] ffi.c: In function ‘check_float’: ffi.c:179:3: error: variable ‘imag’ set but not used [-Werror=unused-but-set-variable] ffi.c: In function ‘check_uintptr’: ffi.c:182:3: error: variable ‘imag’ set but not used [-Werror=unused-but-set-variable] cc1: all warnings being treated as errors make[1]: *** [ffi.o] Error 1 make[1]: Leaving directory/home/daurnimator/src/luaffi' make: *\ [all] Error 2

jmckaskill commented 12 years ago

What system and compiler? With the latest round of changes, I've only had a chance to test on osx and win7.

daurnimator commented 12 years ago

$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: /build/src/gcc-4.7-20120407/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --enable-libstdcxx-time --enable-gnu-unique-object --enable-linker-build-id --with-ppl --enable-cloog-backend=isl --enable-lto --enable-gold --enable-ld=default --enable-plugin --with-plugin-ld=ld.gold --with-linker-hash-style=gnu --enable-multilib --disable-libssp --disable-build-with-cxx --disable-build-poststage1-with-cxx --enable-checking=release --with-fpmath=sse Thread model: posix gcc version 4.7.0 20120407 (prerelease) (GCC)

$ uname -a Linux vm-arch 3.2.13-1-ARCH #1 SMP PREEMPT Sat Mar 24 09:10:39 CET 2012 x86_64 AMD Phenom(tm) II X3 720 Processor AuthenticAMD GNU/Linux

jmckaskill commented 12 years ago

This should now be fixed.