https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89350
--- Comment #7 from Martin Liška <marxin at gcc dot gnu.org> --- Thanks for analysis. > > The bogus warning can be avoided in the first case simply by punting on > offsets that could be in the negative range, but almost certainly not > without some false negatives. Yes, I can confirm that adding a check for negative values can make the warning gone. > I'm not sure it's necessarily a good tradeoff > (I don't know that it isn't either). Is this code representative of some > wide-spread idiom? I see it just in one package.