]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUILD/MINOR: tools: fix build warning in debug_hexdump()
authorWilly Tarreau <w@1wt.eu>
Tue, 11 Apr 2017 05:58:08 +0000 (07:58 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 11 Apr 2017 06:01:17 +0000 (08:01 +0200)
commit73459797fdba710990d835cd018058e5e8c3a52f
tree5f25fb6171a82d2d62837b21aa7d1abda6e799bf
parent9d7fb63e33535cbd81d3c3c5fb512ace19c03ba2
BUILD/MINOR: tools: fix build warning in debug_hexdump()

Commit 0ebb511 ("MINOR: tools: add a generic hexdump function for debugging")
introduced debug_hexdump() which is used to dump a memory area during
debugging sessions. This function can start at an unaligned offset and
uses a signed comparison to know where to start dumping from. But the
operation mixes signed and unsigned, making the test incorrect and causing
the following warnings to be emitted under Clang :

  src/standard.c:3775:14: warning: comparison of unsigned expression >= 0 is
        always true [-Wtautological-compare]
                          if (b + j >= 0 && b + j < len)
                              ~~~~~ ^  ~

Make "j" signed instead. At the moment this function is not used at all
so there's no impact. Thanks to Dmitry Sivachenko for reporting it. No
backport is needed.
src/standard.c