Boszormenyi Zoltan <zb(at)cybertec(dot)at> writes:
> for (; length > 0 && ptr[--length] == 0xff;);
> I suspect that GCC does the "--length" after checking
> "length > 0" and before checking the "ptr[...] == 0xff",
> but HP CC does it before checking "length > 0".
If it does, that is *unquestionably* a bug in HP's CC and should be
reported to them. However, the code is sufficiently unreadable to
be worth rewriting anyhow. Your suggestion is an improvement but
personally I'd plump for
int i;
for (i = 0; i < length; i++)
if (ptr[i] != 0xff)
return false;
return true;
regards, tom lane