Suppress -Wnull-dereference in wxString::GetCacheElement()

It doesn't seem to be really possible here.
This commit is contained in:
Vadim Zeitlin
2020-08-30 23:44:09 +02:00
parent 24914ec7df
commit a535d2c64d

View File

@@ -569,6 +569,12 @@ private:
// its corresponding index in the byte string or not
Cache::Element *GetCacheElement() const
{
// gcc warns about cacheBegin and c inside the loop being possibly null,
// but this shouldn't actually be the case
#if wxCHECK_GCC_VERSION(6,1)
wxGCC_ONLY_WARNING_SUPPRESS(null-dereference)
#endif
Cache::Element * const cacheBegin = GetCacheBegin();
Cache::Element * const cacheEnd = GetCacheEnd();
Cache::Element * const cacheStart = cacheBegin + LastUsedCacheElement();
@@ -598,6 +604,10 @@ private:
}
return c;
#if wxCHECK_GCC_VERSION(6,1)
wxGCC_ONLY_WARNING_RESTORE(null-dereference)
#endif
}
size_t DoPosToImpl(size_t pos) const