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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user