[quake3-commits] r2093 - trunk/code/cgame
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Mon Jul 18 18:02:16 EDT 2011
Author: thilo
Date: 2011-07-18 18:02:16 -0400 (Mon, 18 Jul 2011)
New Revision: 2093
Modified:
trunk/code/cgame/cg_local.h
trunk/code/cgame/cg_syscalls.c
Log:
Shut up returning functions with noreturn attribute warning
Modified: trunk/code/cgame/cg_local.h
===================================================================
--- trunk/code/cgame/cg_local.h 2011-07-18 19:32:25 UTC (rev 2092)
+++ trunk/code/cgame/cg_local.h 2011-07-18 22:02:16 UTC (rev 2093)
@@ -1193,7 +1193,7 @@
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 );
@@ -1475,7 +1475,7 @@
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
Modified: trunk/code/cgame/cg_syscalls.c
===================================================================
--- trunk/code/cgame/cg_syscalls.c 2011-07-18 19:32:25 UTC (rev 2092)
+++ trunk/code/cgame/cg_syscalls.c 2011-07-18 22:02:16 UTC (rev 2093)
@@ -46,8 +46,11 @@
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 ) {
More information about the quake3-commits
mailing list