Re: Silencing the remaining clang 15 warnings

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Silencing the remaining clang 15 warnings
Date: 2022-09-21 15:44:44
Message-ID: 1081321.1663775084@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

HEAD and v15 now compile cleanly for me with clang 15.0.0,
but I find that there's still work to do in the back branches:

* There are new(?) -Wunused-but-set-variable warnings in every older
branch, which we evidently cleaned up or rewrote at one point or
another. I think this is definitely worth fixing in the in-support
branches. I'm a bit less sure if it's worth the trouble in the
out-of-support branches.

* The 9.2 and 9.3 branches spew boatloads of 'undeclared library function'
warnings about strlcpy() and related functions. This is evidently
because 16fbac39f was only back-patched as far as 9.4. There are
enough of these to be pretty annoying if you're trying to build those
branches with clang, so I think this is clearly justified for
back-patching into the older out-of-support branches, assuming that
the patch will work there. (I see that 9.2 and 9.3 were still on the
prior version of autoconf, so it might not be an easy change.)

I also observe that 9.2 and 9.3 produce

float.c:1278:29: warning: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Wimplicit-const-int-float-conversion]

This is because cbdb8b4c0 was only back-patched as far as 9.4.
However, I think that that would *not* be fit material for
back-patching into out-of-support branches, since our policy
for them is "no behavioral changes".

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2022-09-21 15:50:25 Re: Is it time to drop fix-old-flex-code.pl?
Previous Message Jacob Champion 2022-09-21 15:33:55 Re: [PoC] Let libpq reject unexpected authentication requests