Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d89746c

Browse filesBrowse 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
Copy full SHA for d89746c

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎contrib/test_shm_mq/setup.c

Copy file name to clipboardExpand all lines: contrib/test_shm_mq/setup.c
+2-2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.