From 38daed324464666b5a4bb6a758c60e960b4610f0 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Wed, 27 Mar 2013 19:00:50 +0000 Subject: Fix some warnings caused by lack of noreturn --- src/cgame/cg_local.h | 4 ++-- src/cgame/cg_syscalls.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/cgame') diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 148f3328..cf1da82d 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -1542,7 +1542,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 ); int CG_PlayerCount( void ); @@ -1863,7 +1863,7 @@ const char *CG_TutorialText( void ); 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 diff --git a/src/cgame/cg_syscalls.c b/src/cgame/cg_syscalls.c index e3c53411..4765751d 100644 --- a/src/cgame/cg_syscalls.c +++ b/src/cgame/cg_syscalls.c @@ -51,6 +51,8 @@ void trap_Print( const char *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 ) -- cgit