src.ctf.lttng-live: Use SESSION_NOT_FOUND_ACTION_UNKNOWN in place of -1
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 23 Jul 2019 19:55:12 +0000 (15:55 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 29 Jul 2019 14:46:25 +0000 (10:46 -0400)
commitbce81ff21251e1ce35e186f7b6996268a6943c6f
tree0cd5908fea36239e10ae0d63abd81fdd22bc97b7
parent6da709aa5711ee57761028c143fc00b65026c15d
src.ctf.lttng-live: Use SESSION_NOT_FOUND_ACTION_UNKNOWN in place of -1

Seen on clang-3.9, 4.0 and clang-1001.0.46.4.

  Comparison of constant -1 with expression of type 'enum *****'
  is always false [-Wtautological-constant-out-of-range-compare]

Note that the enum underlying type is implementation defined and left to
the choice of the compiler by the standard [1] (6.7.2.2 4). Most
compiler default to unsigned int. The use of -1 is not a problem per see
since wrap around of unsigned int behaviour is not undefined. Using -1
is the equivalent of assigning UINT_MAX here. This warning was removed
for later clang for these specific cases since the effect of always being
false is erroneous.

Still, it make more sense to use a specific enum for such case instead
of relying on the compiler type.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Change-Id: I447d04333ae104ea953437b095053f341f87bbb7
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1763
CI-Build: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/plugins/ctf/lttng-live/lttng-live.c
src/plugins/ctf/lttng-live/lttng-live.h
This page took 0.024626 seconds and 4 git commands to generate.