`ctf` plugin: Use CTF_BYTE_ORDER_UNKNOWN in place of -1
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 23 Jul 2019 21:58:29 +0000 (17:58 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 30 Jul 2019 13:01:56 +0000 (09:01 -0400)
commite2bd7d40c86a2209c18c594b391b2d4c7ea59740
tree838ee77dee8e4f1f2e9178dcc6a37539d7b09718
parentff89ed28f8f411258190b9c1972a58af3d5c850e
`ctf` plugin: Use CTF_BYTE_ORDER_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: I5dcbaa2066cbab8c429ff54e8d8b8b295fc8baf1
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1764
CI-Build: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/plugins/ctf/common/bfcr/bfcr.c
src/plugins/ctf/common/metadata/ctf-meta.h
src/plugins/ctf/common/metadata/visitor-generate-ir.c
This page took 0.025112 seconds and 4 git commands to generate.