Suppress -Wnull-dereference in wxString::GetCacheElement()
It doesn't seem to be really possible here.
This commit is contained in:
@@ -569,6 +569,12 @@ private:
|
|||||||
// its corresponding index in the byte string or not
|
// its corresponding index in the byte string or not
|
||||||
Cache::Element *GetCacheElement() const
|
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 cacheBegin = GetCacheBegin();
|
||||||
Cache::Element * const cacheEnd = GetCacheEnd();
|
Cache::Element * const cacheEnd = GetCacheEnd();
|
||||||
Cache::Element * const cacheStart = cacheBegin + LastUsedCacheElement();
|
Cache::Element * const cacheStart = cacheBegin + LastUsedCacheElement();
|
||||||
@@ -598,6 +604,10 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
|
|
||||||
|
#if wxCHECK_GCC_VERSION(6,1)
|
||||||
|
wxGCC_ONLY_WARNING_RESTORE(null-dereference)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t DoPosToImpl(size_t pos) const
|
size_t DoPosToImpl(size_t pos) const
|
||||||
|
Reference in New Issue
Block a user