g++ strict mode forbids build #227

Closed
dustalov opened this Issue Mar 30, 2010 · 3 comments

Projects

None yet

2 participants

Having gcc version 4.4.3 20100127 (Red Hat 4.4.3-4) (GCC) on Fedora 12 box. Where I attempt to build rubinius 1.0-rc3, I got following compile error:
CC vm/thread_state.cpp
gcc -Ivm/external_libs/libtommath -Ivm/external_libs/libgdtoa -Ivm/external_libs/onig -Ivm/external_libs/libffi/include -Ivm/external_libs/libltdl -Ivm/external_libs/libev -Ivm/test/cxxtest -Ivm -I. -I/usr/local/include -Ivm/external_libs/udis86 -pipe -Wall -Wno-deprecated -DENABLE_LLVM -DHAS_EXECINFO -ggdb3 -O2 -Werror -DRBX_PROFILER -I/usr/include -DNDEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -fomit-frame-pointer -c -o vm/thread_state.o vm/thread_state.cpp 2>&1
cc1plus: warnings being treated as errors
In file included from vm/gc/root.hpp:11,
from vm/globals.hpp:28,
from vm/vm.hpp:4,
from vm/builtin/object.hpp:6,
from vm/builtin/exception.hpp:6,
from vm/thread_state.cpp:1:
vm/util/thread.hpp: In member function 'int thread::Thread::priority()':
vm/util/thread.hpp:155: error: unused variable '_policy'
rake aborted!
Perhaps, for regular builds, we shouldn't use -Werror g++ option?

Anyway, rubinius from git have a same problem, but in another file:
vm/objectmemory.cpp: In member function ‘void rubinius::ObjectMemory::validate_handles(rubinius::capi::Handles*)’:
vm/objectmemory.cpp:215: error: unused variable ‘ih’
rake aborted!
Command failed with status (1): [gcc -Ivm/external_libs/libtommath -Ivm/ext...]

Owner
evanphx commented Mar 30, 2010

This is not a -Werror issue (we always use -Werror) but rather you're not using a prebuilt LLVM and it has injected -DNDEBUG into your cflags, thus causing all assert() calls to disappear. I've been going through and fixing all assert calls to not contain critical code, but it's clear I've missed some. I'll fix this shortly.

Owner
evanphx commented Mar 30, 2010

Fix bad asserts, add build:nodebug to use NDEBUG. Closed by c7d6e65.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment