Fix: src.ctf.fs: initialize the other_entry variable
authorMingli Yu <mingli.yu@windriver.com>
Thu, 12 Mar 2020 03:42:07 +0000 (11:42 +0800)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 8 Apr 2020 18:21:32 +0000 (14:21 -0400)
commit0f77b5c9dfac44ff6eff8fb66fefadea72846c97
tree0d4eda23d54da7697affe9d20d8de6ccb2c71693
parentf03b6364aec2d77bbb5ef0625cbaea8de4179f63
Fix: src.ctf.fs: initialize the other_entry variable

Initialize the pointer other_entry to silence this warning:

    | ../../../../../git/src/plugins/ctf/fs-src/fs.c: In function 'ds_index_insert_ds_index_entry_sorted':
    | ../../../../../git/src/plugins/ctf/fs-src/fs.c:702:5: error: 'other_entry' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    |  702 |    !ds_index_entries_equal(entry, other_entry)) {

This was encountered with gcc 9.2.0 at the -Og optimization level.
After inspection, it appears that this is a false positive, the
`other_entry` pointer can only be used after being initialized first.

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Change-Id: Icf63e605cf543c3eb29e5aadec18b22b137ee9da
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3353
CI-Build: Simon Marchi <simon.marchi@efficios.com>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
src/plugins/ctf/fs-src/fs.c
This page took 0.024604 seconds and 4 git commands to generate.