Skip to content

Commit

Permalink
Fix warning C4702: unreachable code
Browse files Browse the repository at this point in the history
  • Loading branch information
Nopey committed Nov 26, 2024
1 parent 513e27c commit 01436af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ if(MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /we4701")
# C4668: undefined symbol used as compiler directive (will evaluate to 0).
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /we4668")
# C4702: unreachable code
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /we4702")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter -Wformat -pedantic -Wvla")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ggdb -Werror -fno-omit-frame-pointer")
Expand Down
6 changes: 4 additions & 2 deletions src/game/utils/nat.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ bool nat_create_upnp_mapping(nat_ctx *ctx, uint16_t int_port, uint16_t ext_port)
// like overly short lifetimes
return false;
}
#endif
#else
return false;
#endif
}

bool nat_create_pmp_mapping(nat_ctx *ctx, uint16_t int_port, uint16_t ext_port) {
Expand Down Expand Up @@ -70,8 +71,9 @@ bool nat_create_pmp_mapping(nat_ctx *ctx, uint16_t int_port, uint16_t ext_port)
// TODO handle some errors here
return false;
}
#endif
#else
return false;
#endif
}

bool nat_create_mapping(nat_ctx *ctx, uint16_t int_port, uint16_t ext_port) {
Expand Down

0 comments on commit 01436af

Please sign in to comment.