`ctf` plugin: Use is_log_level_set to infer ctf_event_class log_level validity
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 23 Jul 2019 19:23:02 +0000 (15:23 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 29 Jul 2019 14:45:17 +0000 (10:45 -0400)
commit6da709aa5711ee57761028c143fc00b65026c15d
tree69c5ee6fee5c931259e848036b0aa56f5cff61b6
parenta29ba23b453b2e2e62b40f77d49ee45db444ccfc
`ctf` plugin: Use is_log_level_set to infer ctf_event_class log_level validity

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.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Change-Id: I6ce97c2481f36573d1a221b59e2459f1fe35ded9
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1761
CI-Build: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/plugins/ctf/common/metadata/ctf-meta-translate.c
src/plugins/ctf/common/metadata/ctf-meta.h
src/plugins/ctf/common/metadata/visitor-generate-ir.c
This page took 0.024819 seconds and 4 git commands to generate.