Skip site navigation (1) Skip section navigation (2)

Compiler warnings

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Compiler warnings
Date: 2016-11-29 15:21:02
Message-ID: 20161129152102.GR13284@tamriel.snowman.net (view raw, whole thread or download thread mbox)
Thread:
Lists: pgsql-hackers
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

.../src/backend/storage/lmgr/lwlock.c: In function ‘LWLockRelease’:
.../src/backend/storage/lmgr/lwlock.c:1802:5: warning: ‘mode’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  if (mode == LW_EXCLUSIVE)
     ^
.../src/backend/utils/cache/plancache.c: In function ‘GetCachedPlan’:
.../src/backend/utils/cache/plancache.c:1232:9: warning: ‘plan’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  return plan;
         ^

Thoughts?

Thanks!

Stephen

Attachment: silence-warnings.patch
Description: text/x-diff (1.1 KB)

Responses

pgsql-hackers by date

Next:From: Stephen FrostDate: 2016-11-29 15:25:38
Subject: Re: Compiler warnings
Previous:From: Simon RiggsDate: 2016-11-29 15:13:57
Subject: Re: Proposal for changes to recovery.conf API

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group