[haiku-bugs] [Haiku] #12825: [Patch] net_buffer.cpp: Fix clang warning

  • From: "mt" <trac@xxxxxxxxxxxx>
  • Date: Tue, 21 Jun 2016 21:35:58 -0000

#12825: [Patch] net_buffer.cpp: Fix clang warning
--------------------------------------+------------------------------
 Reporter:  mt                        |        Owner:  axeld
     Type:  bug                       |       Status:  new
 Priority:  normal                    |    Milestone:  Unscheduled
Component:  Network & Internet/Stack  |      Version:  R1/Development
 Keywords:                            |   Blocked By:
 Blocking:                            |  Has a Patch:  0
 Platform:  All                       |
--------------------------------------+------------------------------
 In remove_header(), 'while (left >= 0)' at line 1823 is always true
 because 'left' is unsigned. so I think we may change condition to 'while
 (left > 0)'.

 {{{
 /home/haiku/haiku/haiku/src/add-
 ons/kernel/network/stack/net_buffer.cpp:1823:14: warning: comparison of
 unsigned expression >= 0 is always true [-Wtautological-compare]
         while (left >= 0) {
                ~~~~ ^  ~
 }}}

--
Ticket URL: <https://dev.haiku-os.org/ticket/12825>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: