fix: add missing -lm link flag and fix GCC warnings for getline and switch coverage

Add -lm flag to both debug and release linker commands in Makefile to resolve
undefined math library references. Define _GNU_SOURCE in main.c to make getline()
available under GCC. Add default cases to switch statements in runFile and
getNumArguments to suppress -Wswitch warnings. Fix u_int8_t to uint8_t type in
wrenNewFunction declaration and definition for POSIX compliance.
This commit is contained in:
Bob Nystrom
2014-11-26 22:03:05 +00:00
parent d60068db56
commit d9a42f21ba
5 changed files with 13 additions and 4 deletions
+2 -2
View File
@@ -27,7 +27,7 @@ debug: prep wrend
# Debug command-line interpreter.
wrend: $(DEBUG_OBJECTS)
$(CC) $(CFLAGS) $(DEBUG_CFLAGS) -Iinclude -o wrend $^
$(CC) $(CFLAGS) $(DEBUG_CFLAGS) -Iinclude -lm -o wrend $^
# Debug object files.
build/debug/%.o: src/%.c include/wren.h $(HEADERS)
@@ -38,7 +38,7 @@ release: prep wren
# Release command-line interpreter.
wren: $(RELEASE_OBJECTS)
$(CC) $(CFLAGS) $(RELEASE_CFLAGS) -Iinclude -o wren $^
$(CC) $(CFLAGS) $(RELEASE_CFLAGS) -Iinclude -lm -o wren $^
# Release object files.
build/release/%.o: src/%.c include/wren.h $(HEADERS)