Skip to content
Snippets Groups Projects
Commit 07160ab1 authored by Alexander V. Tikhonov's avatar Alexander V. Tikhonov Committed by Kirill Yukhin
Browse files

build: fix uninitialized ptr before use

Found issues building on Fedora 33:

  test/unit/fiber_channel.cc: In function ‘fiber_channel_basic’:
  test/unit/fiber_channel.cc:40:2: error: ‘ptr’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     40 |  ok(ptr == &dummy, "fiber_channel_get()");
        |  ^
  test/unit/fiber_channel.cc:37:8: note: ‘ptr’ was declared here
     37 |  void *ptr;
        |        ^

  test/unit/fiber_channel.cc: In function ‘fiber_channel_get’:
  test/unit/fiber_channel.cc:63:2: error: ‘ptr’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     63 |  ok(ptr == &dummy, "fiber_channel_get(0)");
        |  ^
  test/unit/fiber_channel.cc:61:8: note: ‘ptr’ was declared here
     61 |  void *ptr;
        |        ^

To fix the issue set ptr to NULL during initialization.

Needed for #5502
Part of #5697
parent e90a971d
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment