diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f418431d..a0aa5f54 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -141,4 +141,5 @@ jobs: - name: Run cppcheck shell: bash run: | - cppcheck --version ; cppcheck --error-exitcode=1 -j4 -q --force -U_WIN32 -Isrc opl src setup textscreen + cppcheck --version + cppcheck --error-exitcode=1 -j4 -q --force -D__GNUC__ -U_MSC_VER -U_WIN32 -Isrc opl src setup textscreen diff --git a/src/g_game.c b/src/g_game.c index 08492a19..eb956857 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -294,7 +294,7 @@ static int G_NextWeapon(int direction) if (i == arrlen(weapon_order_table)) { - return wp_nochange; + I_Error("G_NextWeapon: Invalid weapon type %d", (int)weapon); } // Switch weapon. Don't loop forever. diff --git a/src/i_system.h b/src/i_system.h index 3057a340..2e95dd97 100644 --- a/src/i_system.h +++ b/src/i_system.h @@ -60,7 +60,7 @@ ticcmd_t* I_BaseTiccmd (void); // killough 3/20/98: add const // killough 4/25/98: add gcc attributes -void I_ErrorOrSuccess(int err_code, const char *error, ...) PRINTF_ATTR(2, 3); +void I_ErrorOrSuccess(int err_code, const char *error, ...) NORETURN PRINTF_ATTR(2, 3); #define I_Error(...) I_ErrorOrSuccess(-1, __VA_ARGS__) #define I_Success(...) I_ErrorOrSuccess(0, __VA_ARGS__)