diff options
author | Tim Angus <tim@ngus.net> | 2013-03-27 19:00:50 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-03-27 19:00:50 +0000 |
commit | 38daed324464666b5a4bb6a758c60e960b4610f0 (patch) | |
tree | e85a8d868ccc91833955be39bf35ca65485fb262 /src/ui | |
parent | f68ed0529955386976608b235b26f0abe8fc87c4 (diff) |
Fix some warnings caused by lack of noreturn
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/ui_local.h | 2 | ||||
-rw-r--r-- | src/ui/ui_shared.h | 2 | ||||
-rw-r--r-- | src/ui/ui_syscalls.c | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/src/ui/ui_local.h b/src/ui/ui_local.h index f57bc188..75b316b6 100644 --- a/src/ui/ui_local.h +++ b/src/ui/ui_local.h @@ -315,7 +315,7 @@ void UI_FillRect( float x, float y, float width, float height, const float // ui_syscalls.c // void trap_Print( const char *string ); -void trap_Error( const char *string ); +void trap_Error( const char *string ) __attribute__((noreturn)); int trap_Milliseconds( void ); void trap_Cvar_Register( vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int flags ); void trap_Cvar_Update( vmCvar_t *vmCvar ); diff --git a/src/ui/ui_shared.h b/src/ui/ui_shared.h index 701fb75e..76d3bca6 100644 --- a/src/ui/ui_shared.h +++ b/src/ui/ui_shared.h @@ -431,7 +431,7 @@ typedef struct void ( *getBindingBuf )( int keynum, char *buf, int buflen ); void ( *setBinding )( int keynum, const char *binding ); void ( *executeText )( int exec_when, const char *text ); - void ( *Error )( int level, const char *error, ... ) __attribute__ ((format (printf, 2, 3))); + void ( *Error )( int level, const char *error, ... ) __attribute__ ((noreturn, format (printf, 2, 3))); void ( *Print )( const char *msg, ... ) __attribute__ ((format (printf, 1, 2))); void ( *Pause )( qboolean b ); int ( *ownerDrawWidth )( int ownerDraw, float scale ); diff --git a/src/ui/ui_syscalls.c b/src/ui/ui_syscalls.c index e59343e1..f44a749f 100644 --- a/src/ui/ui_syscalls.c +++ b/src/ui/ui_syscalls.c @@ -48,6 +48,8 @@ void trap_Print( const char *string ) void trap_Error( const char *string ) { syscall( UI_ERROR, string ); + // shut up GCC warning about returning functions, because we know better + exit(1); } int trap_Milliseconds( void ) |