Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBkFz-00071I-1b for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Nov 2016 15:23:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cBkFx-00049R-KR for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Nov 2016 15:23:41 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cBkEX-0002a3-Qb for pgsql-hackers@postgresql.org; Tue, 29 Nov 2016 15:22:13 +0000 Received: from tamriel.snowman.net ([72.66.115.51]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBkEQ-0003yF-QQ for pgsql-hackers@postgresql.org; Tue, 29 Nov 2016 15:22:12 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 08C8F5F7A0; Tue, 29 Nov 2016 10:21:02 -0500 (EST) Date: Tue, 29 Nov 2016 10:21:02 -0500 From: Stephen Frost To: pgsql-hackers@postgresql.org Subject: Compiler warnings Message-ID: <20161129152102.GR13284@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="X6jspQRIhCX2/PVj" Content-Disposition: inline X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-91-generic (x86_64) X-Uptime: 10:09:05 up 143 days, 16:33, 25 users, load average: 0.20, 0.16, 0.11 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -4.8 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org --X6jspQRIhCX2/PVj Content-Type: multipart/mixed; boundary="0yIEv4ciajEKQOWx" Content-Disposition: inline --0yIEv4ciajEKQOWx Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, Not sure if anyone else has been seeing these, but I'm getting a bit tired of them. Neither is a live bug, but they also seem pretty simple to fix. The attached patch makes both of these warnings go away. At least for my common build, these are the only warnings that are thrown. I'm building with: gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 =2E../src/backend/storage/lmgr/lwlock.c: In function =E2=80=98LWLockRelease= =E2=80=99: =2E../src/backend/storage/lmgr/lwlock.c:1802:5: warning: =E2=80=98mode=E2= =80=99 may be used uninitialized in this function [-Wmaybe-uninitialized] if (mode =3D=3D LW_EXCLUSIVE) ^ =2E../src/backend/utils/cache/plancache.c: In function =E2=80=98GetCachedPl= an=E2=80=99: =2E../src/backend/utils/cache/plancache.c:1232:9: warning: =E2=80=98plan=E2= =80=99 may be used uninitialized in this function [-Wmaybe-uninitialized] return plan; ^ Thoughts? Thanks! Stephen --0yIEv4ciajEKQOWx Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="silence-warnings.patch" Content-Transfer-Encoding: quoted-printable diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/l= wlock.c new file mode 100644 index 9c6862f..909ff45 *** a/src/backend/storage/lmgr/lwlock.c --- b/src/backend/storage/lmgr/lwlock.c *************** LWLockUpdateVar(LWLock *lock, uint64 *va *** 1770,1776 **** void LWLockRelease(LWLock *lock) { ! LWLockMode mode; uint32 oldstate; bool check_waiters; int i; --- 1770,1776 ---- void LWLockRelease(LWLock *lock) { ! LWLockMode mode =3D LW_EXCLUSIVE; uint32 oldstate; bool check_waiters; int i; diff --git a/src/backend/utils/cache/plancache.c b/src/backend/utils/cache/= plancache.c new file mode 100644 index 884cdab..b5d97c8 *** a/src/backend/utils/cache/plancache.c --- b/src/backend/utils/cache/plancache.c *************** GetCachedPlan(CachedPlanSource *plansour *** 1196,1204 **** */ qlist =3D NIL; } ! } !=20 ! if (customplan) { /* Build a custom plan */ plan =3D BuildCachedPlan(plansource, qlist, boundParams); --- 1196,1203 ---- */ qlist =3D NIL; } ! }=20 ! else { /* Build a custom plan */ plan =3D BuildCachedPlan(plansource, qlist, boundParams); --0yIEv4ciajEKQOWx-- --X6jspQRIhCX2/PVj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJYPZzeAAoJEO1sijiDR2RVUdkP+gKkK24grUb0Vqr93uB+S7o2 kKlZG9mG+d25L2El1ttg2ylogwC+gD+k6knhU5BQqECxb/rSo+MV52nkyZl9ZBxw jL17Ye07k0CXhWFuX0nwfHDCbKuxyF8zn/jvPM6r7QnBN8GQrbJYR9z84O52m8yL hUZdoM6yFCsFjYUgSsAKxq4FW1AhSXp+017yLVoLDECK4IhYaecmvQ7NXa4ocrTk drxozzgl9x0DZx68zmAqw9OmkNB3HA2ntzuBXGtvjQHlCTmfv9FoPXLOgKTNXCkY hOsjaOhmf/rIU/h20pFfPs8I57dKQLaHqC3Gthz8X6WGh40NrX4brdcLAeqExbpz SrOWxGs1K3dKzPBKuRAuUK+5BHu/YSNk4/HWCQxqV1JKAdALutr+pgA0tTQeZunW qYIlFIpDggv5QVA/hY2bwNteDXC+hZsqV7pKUuq4DxxbYOpDXhIgfdCzdhtxKxfy zKl8UKXMtWvbWkGGbsQRhB3Gf2d0DUnA1+Io+V15qucd1Ecc9ZREsg1LYiyYPWMH U9WfGAko1MncYZW1DFevEMxQQc0fWwJs4JX3DXGCindkOBk+DnrcaeYf28XK6rVu ajFxxFgWG+pn5oKYWg+Qbn/xKaUSmnsi0KDxdAcnGhajE1v+BToVnhTTeBsDPGkU Qr0ReTKOD9zeRwrSqhRR =33g+ -----END PGP SIGNATURE----- --X6jspQRIhCX2/PVj--