Skip to content

Commit d89746c

Browse files
committed
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.
1 parent be361ef commit d89746c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/test_shm_mq/setup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ test_shm_mq_setup(uint64 queue_size, int32 nworkers, dsm_segment **segp,
5050
{
5151
dsm_segment *seg;
5252
test_shm_mq_header *hdr;
53-
shm_mq *outq;
54-
shm_mq *inq;
53+
shm_mq *outq = NULL; /* placate compiler */
54+
shm_mq *inq = NULL; /* placate compiler */
5555
worker_state *wstate;
5656

5757
/* Set up a dynamic shared memory segment. */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy