On Fri, Sep 25, 2026 at 01:58:17PM -0400, Tom Lane wrote:
> I think this odd coding, perhaps combined with all the cowboy casting
> that's going on here, is what's confusing gcc into giving a warning.
> I propose the attached patch to make this code less ugly and (with
> luck) suppress the warning.
Getting rid of the "q" variable altogether might have a better chance of
clearing the warnings, and IMHO it further improves readability:
> + q = &keybuf.bytes[0];
> + while (q < &keybuf.bytes[8])
> {
> *q++ = *key << 1;
for (i = 0; i < 8; i++)
{
keybuf.bytes[i] = *key << 1;
> + q = &keybuf.bytes[0];
> + while (q < &keybuf.bytes[8] && *key)
> *q++ ^= *key++ << 1;
for (i = 0; i < 8 && *key; i++)
keybuf.bytes[i] ^= *key++ << 1;
--
nathan