[haiku-bugs] [Haiku] #6789: Wrong comparison in tcp add-on

  • From: "kaliber" <trac@xxxxxxxxxxxx>
  • Date: Fri, 05 Nov 2010 17:14:56 -0000

#6789: Wrong comparison in tcp add-on
--------------------------------------+-----------------------------
   Reporter:  kaliber                 |       Owner:  axeld
       Type:  bug                     |      Status:  new
   Priority:  normal                  |   Milestone:  R1
  Component:  Network & Internet/TCP  |     Version:  R1/Development
   Keywords:                          |  Blocked By:
Has a Patch:  0                       |    Platform:  All
   Blocking:                          |
--------------------------------------+-----------------------------
 Here is clang diagnose:

 {{{
 src/add-ons/kernel/network/protocols/tcp/tcp.cpp:201:43: error: comparison
 of unsigned expression >= 0 is always true [-Wtautological-compare]
                                 if (option->length == 4 && (size - 4) >=
 0)
                                                            ~~~~~~~~~~ ^  ~
 src/add-ons/kernel/network/protocols/tcp/tcp.cpp:205:43: error: comparison
 of unsigned expression >= 0 is always true [-Wtautological-compare]
                                 if (option->length == 3 && (size - 3) >=
 0) {
                                                            ~~~~~~~~~~ ^  ~
 src/add-ons/kernel/network/protocols/tcp/tcp.cpp:211:45: error: comparison
 of unsigned expression >= 0 is always true [-Wtautological-compare]
                                 if (option->length == 10 && (size - 10) >=
 0) {
                                                             ~~~~~~~~~~~ ^
 ~
 src/add-ons/kernel/network/protocols/tcp/tcp.cpp:219:43: error: comparison
 of unsigned expression >= 0 is always true [-Wtautological-compare]
                                 if (option->length == 2 && (size - 2) >=
 0)
                                                            ~~~~~~~~~~ ^  ~
 }}}

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

Other related posts: