summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2013-03-27 19:00:50 +0000
committerTim Angus <tim@ngus.net>2013-03-27 19:00:50 +0000
commit38daed324464666b5a4bb6a758c60e960b4610f0 (patch)
treee85a8d868ccc91833955be39bf35ca65485fb262 /src/cgame
parentf68ed0529955386976608b235b26f0abe8fc87c4 (diff)
Fix some warnings caused by lack of noreturn
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_local.h4
-rw-r--r--src/cgame/cg_syscalls.c2
2 files changed, 4 insertions, 2 deletions
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 )