]> sourceware.org Git - systemtap.git/commit
util.cxx: Use abs() instead of labs()
authorTimm Bäder <tbaeder@redhat.com>
Wed, 19 May 2021 20:23:06 +0000 (16:23 -0400)
committerAaron Merey <amerey@redhat.com>
Wed, 19 May 2021 20:23:06 +0000 (16:23 -0400)
commit14f04522b5686ba4715043f355fc553670d56150
treec86e4604e97201ff668e8aa27a649257dc9fba63
parent13016e9dd62e8b96b13922915d2a78901d35afff
util.cxx: Use abs() instead of labs()

Taking the absolute value of unsigned values is pointless, as reported
by clang:

util.cxx:1545:28: error: taking the absolute value of unsigned type 'unsigned long' has no effect [-Werror,-Wabsolute-value]
      unsigned min_score = labs(target.size() - it->size());
                           ^
util.cxx:1545:28: note: remove the call to 'labs' since unsigned values cannot be negative
      unsigned min_score = labs(target.size() - it->size());
util.cxx
This page took 0.028193 seconds and 5 git commands to generate.