Fix: lttng: add-context: silence coverity warning
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 18 Oct 2021 18:43:18 +0000 (14:43 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 18 Oct 2021 18:43:54 +0000 (14:43 -0400)
commit261e7f1360fffe91b0b690c8a0715f4f6d2c4a7e
tree508f2f58d46b095b3d44cdd908f9171386cf8a7a
parentf895927f329180ca1e6f4426e9d3c6250ae698ba
Fix: lttng: add-context: silence coverity warning

Coverity reports that:
  1464653 Uninitialized scalar field
  The field will contain an arbitrary value left over from earlier
  computations.

  In ctx_opts::​ctx_opts(): A scalar field is not initialized by the
  constructor.

   uninit_member: Non-static class member hide_help is not initialized
   in this constructor nor in any functions that it calls.

In our case it doesn't matter since a nullptr symbol indicates the end
the ctx_opts array. An "unknown" value is added to the context array
and used to initialize the end-of-list item to an invalid value.

Calling the ctx_opts(const char *symbol_, context_type ctx_type_, bool
hide_help_ = false) constructor causes `hide_help` to be initialized.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ie685fef5712705a1938d9e6b8a63d23ab5bc6b39
src/bin/lttng/commands/add_context.cpp
This page took 0.02473 seconds and 4 git commands to generate.