Skip to content

Commit

Permalink
Shut up returning functions with noreturn attribute warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Thilo Schulz committed Jul 18, 2011
1 parent b248479 commit dd859ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions code/cgame/cg_local.h
Expand Up @@ -1193,7 +1193,7 @@ const char *CG_ConfigString( int index );
const char *CG_Argv( int arg );

void QDECL CG_Printf( const char *msg, ... ) __attribute__ ((format (printf, 1, 2)));
void QDECL CG_Error( const char *msg, ... ) __attribute__ ((format (printf, 1, 2)));
void QDECL CG_Error( const char *msg, ... ) __attribute__ ((noreturn, format (printf, 1, 2)));

void CG_StartMusic( void );

Expand Down Expand Up @@ -1475,7 +1475,7 @@ void CG_CheckChangedPredictableEvents( playerState_t *ps );
void trap_Print( const char *fmt );

// abort the game
void trap_Error( const char *fmt );
void trap_Error(const char *fmt) __attribute__((noreturn));

// milliseconds should only be used for performance tuning, never
// for anything game related. Get time from the CG_DrawActiveFrame parameter
Expand Down
7 changes: 5 additions & 2 deletions code/cgame/cg_syscalls.c
Expand Up @@ -46,8 +46,11 @@ void trap_Print( const char *fmt ) {
syscall( CG_PRINT, fmt );
}

void trap_Error( const char *fmt ) {
syscall( CG_ERROR, fmt );
void trap_Error(const char *fmt)
{
syscall(CG_ERROR, fmt);
// shut up GCC warning about returning functions, because we know better
exit(1);
}

int trap_Milliseconds( void ) {
Expand Down

0 comments on commit dd859ae

Please sign in to comment.