summaryrefslogtreecommitdiff
path: root/contrib/test_shm_mq/setup.c
diff options
context:
space:
mode:
authorRobert Haas2014-01-15 15:24:28 +0000
committerRobert Haas2014-01-15 15:24:28 +0000
commitd89746c7c534ef5b061fee0b8f587042f55bd92d (patch)
treea105e28736b4c7c7b00be0b2d5b3700c21a8b38b /contrib/test_shm_mq/setup.c
parentbe361ef2a0b58ce1f3faff7ccabe174e20d50497 (diff)
Fix compiler warning.
Kevin Gritter reports that his compiler complains about inq and outq being possibly-uninitialized at the point where they are passed to shm_mq_attach(). They are initialized by the call to setup_dynamic_shared_memory, but apparently his compiler is inlining that function and then having doubts about whether the for loop will always execute at least once. Fix by initializing them to NULL.
Diffstat (limited to 'contrib/test_shm_mq/setup.c')
-rw-r--r--contrib/test_shm_mq/setup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/test_shm_mq/setup.c b/contrib/test_shm_mq/setup.c
index 57800410753..b34d4b3eab0 100644
--- a/contrib/test_shm_mq/setup.c
+++ b/contrib/test_shm_mq/setup.c
@@ -50,8 +50,8 @@ test_shm_mq_setup(uint64 queue_size, int32 nworkers, dsm_segment **segp,
{
dsm_segment *seg;
test_shm_mq_header *hdr;
- shm_mq *outq;
- shm_mq *inq;
+ shm_mq *outq = NULL; /* placate compiler */
+ shm_mq *inq = NULL; /* placate compiler */
worker_state *wstate;
/* Set up a dynamic shared memory segment. */