mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-23 00:15:58 +01:00
Add a value to FLOAT_TRAIT enum to enforce use of default case in switches
Revert the previous commit. Add tests for extended enum cases. Fix crash due to accessing 'trait_names' array out of bounds. Adding an extra invalid value to the end of an enum causes '-Wswitch' flag to warn unless there is a switch default case - also enabled by '-Wall'.
This commit is contained in:
@@ -28,6 +28,9 @@ coverage: $(BUILD_DIR)/testunityRunner.c
|
||||
uncovered:
|
||||
grep '###' $(BUILD_DIR)/unity.c.gcov -C2 || true
|
||||
|
||||
test: CFLAGS += -Wbad-function-cast -Wcast-qual -Wconversion -Wformat=2 -Wold-style-definition \
|
||||
-Wpointer-arith -Wshadow -Wstrict-overflow=5 -Wstrict-prototypes -Wswitch-default -Wundef \
|
||||
-Wunreachable-code -Wunused -fstrict-aliasing
|
||||
test: $(BUILD_DIR)/testunityRunner.c
|
||||
$(CC) $(CFLAGS) $(DEFINES) $(INC_DIR) $(SRC) -o $(TARGET)
|
||||
./$(TARGET)
|
||||
|
||||
Reference in New Issue
Block a user