fix: restructure REPL loop to eliminate unreachable code after fgets failure
The original REPL loop had an if-else structure where the else branch (handling fgets failure) contained a return statement, making the code after the if-else block unreachable. This commit restructures the loop by inverting the condition: when fgets fails, the loop breaks instead of returning, allowing the subsequent wrenFreeVM call to execute. Additionally, enables CLANG_WARN_UNREACHABLE_CODE in both Debug and Release Xcode build configurations to catch similar issues in the future.
This commit is contained in:
@@ -269,6 +269,7 @@
|
||||
29AB1F101816E3AD004B501E /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = c99;
|
||||
GCC_WARN_PEDANTIC = NO;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
@@ -278,6 +279,7 @@
|
||||
29AB1F111816E3AD004B501E /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = c99;
|
||||
GCC_WARN_PEDANTIC = NO;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
|
||||
Reference in New Issue
Block a user