Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make warnings treated as errors for dispatch.c and protect.c #712

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions native/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ JNISFX=$(LIBSFX)
CC=gcc
LD=$(CC)
LIBS=
# CC_OPTS only applied to objects build for jnidispatch, not for libffi
# -Wno-unknown-warning-option
# => Suppress warning for unknown warnings
# -Werror => Treat warnings as errors
# -Wno-clobbered => Silence GCC warning about clobbered automatic variables.
# The "longjmp" case only happens in protect.h in the logic
# that implements "protected" mode. In that case an exception
# is raised and the value of the potentially clobbered
# variables is ignored.
LOC_CC_OPTS=-Wno-unknown-warning-option -Werror -Wno-clobbered
# Default to Sun recommendations for JNI compilation
COPT=-O2 -fno-omit-frame-pointer -fno-strict-aliasing
CASM=-S
Expand Down Expand Up @@ -402,13 +412,13 @@ endif
$(BUILD)/%.o : %.c dispatch.h protect.h $(FFI_LIB)
@mkdir -p $(BUILD)
ifneq ($(SDKROOT),)
$(CC) -arch $(ARCH) $(CFLAGS) -c $< -o $@.$(ARCH)
$(CC) $(LOC_CC_OPTS) -arch $(ARCH) $(CFLAGS) -c $< -o $@.$(ARCH)
for arch in $(ALT_ARCHS); do \
$(CC) -arch $$arch -I$(BUILD)/libffi.$$arch/include $(CFLAGS) -c $< -o $@.$$arch; \
$(CC) $(LOC_CC_OPTS) -arch $$arch -I$(BUILD)/libffi.$$arch/include $(CFLAGS) -c $< -o $@.$$arch; \
done
lipo -create -output $@ $@.*
else
$(CC) $(CFLAGS) -c $< $(COUT)
$(CC) $(CFLAGS) $(LOC_CC_OPTS) -c $< $(COUT)
endif

all: $(LIBRARY) $(TESTLIB) $(TESTLIB2) $(TESTLIB_JAR) $(TESTLIB_PATH) $(TESTLIB_TRUNC)
Expand Down
Loading