summaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
authorThilo Schulz <arny@ats.s.bawue.de>2011-07-18 14:56:57 +0000
committerTim Angus <tim@ngus.net>2013-01-10 22:30:51 +0000
commit61d3cdbb34ed7ebaa9a9a3c4f13595488b80c8f5 (patch)
treed44aabf9275f27eacbf6b877eed878a4ae3ee671 /src/sys
parent2e4f58b4422995f703e51aa92a7e49d0d0664f00 (diff)
Bug 4812 - GCC __attribute__ annotations for printf, non-returning functions etc., patch by linux@youmustbejoking.demon.co.uk and Zack Middleton
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/sys_local.h2
-rw-r--r--src/sys/sys_main.c7
2 files changed, 5 insertions, 4 deletions
diff --git a/src/sys/sys_local.h b/src/sys/sys_local.h
index 8f99e7c5..2c12a464 100644
--- a/src/sys/sys_local.h
+++ b/src/sys/sys_local.h
@@ -53,7 +53,7 @@ void Sys_GLimpSafeInit( void );
void Sys_GLimpInit( void );
void Sys_PlatformInit( void );
void Sys_PlatformExit( void );
-void Sys_SigHandler( int signal );
+void Sys_SigHandler( int signal ) __attribute__ ((noreturn));
void Sys_ErrorDialog( const char *error );
void Sys_AnsiColorPrint( const char *msg );
diff --git a/src/sys/sys_main.c b/src/sys/sys_main.c
index 8bc5f80f..9e4d6863 100644
--- a/src/sys/sys_main.c
+++ b/src/sys/sys_main.c
@@ -194,7 +194,7 @@ Sys_Exit
Single exit point (regular exit or in case of error)
=================
*/
-static void Sys_Exit( int exitCode )
+static __attribute__ ((noreturn)) void Sys_Exit( int exitCode )
{
CON_Shutdown( );
@@ -352,18 +352,18 @@ void Sys_Error( const char *error, ... )
Q_vsnprintf (string, sizeof(string), error, argptr);
va_end (argptr);
- CL_Shutdown(string, qtrue);
Sys_ErrorDialog( string );
Sys_Exit( 3 );
}
+#if 0
/*
=================
Sys_Warn
=================
*/
-void Sys_Warn( char *warning, ... )
+static __attribute__ ((format (printf, 1, 2))) void Sys_Warn( char *warning, ... )
{
va_list argptr;
char string[1024];
@@ -374,6 +374,7 @@ void Sys_Warn( char *warning, ... )
CON_Print( va( "Warning: %s", string ) );
}
+#endif
/*
============