From e6a287c18f40a7bd39fb337477936a8b87666a41 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Tue, 18 Sep 2012 22:19:59 +0200 Subject: [PATCH] Move #pragma GCC diagnostic out of function ..because older GCC versions don't like that --- neo/idlib/containers/List.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/neo/idlib/containers/List.h b/neo/idlib/containers/List.h index e591a585..ddb214f1 100644 --- a/neo/idlib/containers/List.h +++ b/neo/idlib/containers/List.h @@ -356,6 +356,10 @@ Allocates memory for the amount of elements requested while keeping the contents Contents are copied using their = operator so that data is correnctly instantiated. ================ */ +#pragma GCC diagnostic push +// shut up GCC's stupid "warning: assuming signed overflow does not occur when assuming that +// (X - c) > X is always false [-Wstrict-overflow]" +#pragma GCC diagnostic ignored "-Wstrict-overflow" template< class type > ID_INLINE void idList::Resize( int newsize ) { type *temp; @@ -377,14 +381,9 @@ ID_INLINE void idList::Resize( int newsize ) { temp = list; size = newsize; -#pragma GCC diagnostic push -// shut up GCC's stupid "warning: assuming signed overflow does not occur when assuming that -// (X - c) > X is always false [-Wstrict-overflow]" -#pragma GCC diagnostic ignored "-Wstrict-overflow" if ( size < num ) { num = size; } -#pragma GCC diagnostic pop // copy the old list into our new one list = new type[ size ]; @@ -397,6 +396,7 @@ ID_INLINE void idList::Resize( int newsize ) { delete[] temp; } } +#pragma GCC diagnostic pop /* ================