diff options
author | Tim Angus <tim@ngus.net> | 2011-10-27 21:32:28 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-10 23:38:31 +0000 |
commit | 43285fefafed6821fb277c71da7b28d5291d87dd (patch) | |
tree | 0226ebc695a8b5964f98385aa0ba842bf44065b4 /src/qcommon | |
parent | 6fa292451d11608d1588f1b28569ccb2dd1cea57 (diff) |
* Fix various warnings with GCC and clang
Diffstat (limited to 'src/qcommon')
-rw-r--r-- | src/qcommon/common.c | 5 | ||||
-rw-r--r-- | src/qcommon/q_shared.c | 3 | ||||
-rw-r--r-- | src/qcommon/q_shared.h | 6 |
3 files changed, 9 insertions, 5 deletions
diff --git a/src/qcommon/common.c b/src/qcommon/common.c index be91b245..c2d5d353 100644 --- a/src/qcommon/common.c +++ b/src/qcommon/common.c @@ -2325,10 +2325,7 @@ A way to force a bus error for development reasons ================= */ static void Com_Crash_f( void ) { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wnull-dereference" - * ( int * ) 0 = 0x12345678; -#pragma clang diagnostic pop + * ( volatile int * ) 0 = 0x12345678; } /* diff --git a/src/qcommon/q_shared.c b/src/qcommon/q_shared.c index 00473dbf..68be72ab 100644 --- a/src/qcommon/q_shared.c +++ b/src/qcommon/q_shared.c @@ -707,11 +707,12 @@ int Q_isalpha( int c ) qboolean Q_isanumber( const char *s ) { char *p; + double UNUSED_VAR d; if( *s == '\0' ) return qfalse; - strtod( s, &p ); + d = strtod( s, &p ); return *p == '\0'; } diff --git a/src/qcommon/q_shared.h b/src/qcommon/q_shared.h index e007ae24..87750692 100644 --- a/src/qcommon/q_shared.h +++ b/src/qcommon/q_shared.h @@ -83,6 +83,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #endif #endif +#ifdef __GNUC__ +#define UNUSED_VAR __attribute__((unused)) +#else +#define UNUSED_VAR +#endif + #if (defined _MSC_VER) #define Q_EXPORT __declspec(dllexport) #elif (defined __SUNPRO_C) |