Merge pull request #1365 from fabiangreffrath/noreturn

mark I_ErrorOrSuccess() with attribute NORETURN
This commit is contained in:
Fabian Greffrath 2024-01-03 12:18:53 +01:00 committed by GitHub
commit f67fb0784e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -141,4 +141,5 @@ jobs:
- name: Run cppcheck - name: Run cppcheck
shell: bash shell: bash
run: | 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

View File

@ -294,7 +294,7 @@ static int G_NextWeapon(int direction)
if (i == arrlen(weapon_order_table)) 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. // Switch weapon. Don't loop forever.

View File

@ -60,7 +60,7 @@ ticcmd_t* I_BaseTiccmd (void);
// killough 3/20/98: add const // killough 3/20/98: add const
// killough 4/25/98: add gcc attributes // 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_Error(...) I_ErrorOrSuccess(-1, __VA_ARGS__)
#define I_Success(...) I_ErrorOrSuccess(0, __VA_ARGS__) #define I_Success(...) I_ErrorOrSuccess(0, __VA_ARGS__)