diff --git a/include/wx/string.h b/include/wx/string.h index ab0a72b737..2dc071290a 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -554,6 +554,12 @@ private: if ( cacheBegin == NULL ) return NULL; #endif + + // gcc 7 warns about not being able to optimize this loop because of + // possible loop variable overflow, really not sure what to do about + // this, so just disable this warnings for now + wxGCC_ONLY_WARNING_SUPPRESS(unsafe-loop-optimizations) + Cache::Element * const cacheEnd = GetCacheEnd(); for ( Cache::Element *c = cacheBegin; c != cacheEnd; c++ ) { @@ -561,6 +567,8 @@ private: return c; } + wxGCC_ONLY_WARNING_RESTORE(unsafe-loop-optimizations) + return NULL; }