[haiku-bugs] [Haiku] #12824: [Patch] partitioning_systems/gpt/utility.cpp: Fix clang warnings

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

#12824: [Patch] partitioning_systems/gpt/utility.cpp: Fix clang warnings
--------------------------------------+------------------------------
 Reporter:  mt                        |        Owner:  axeld
     Type:  bug                       |       Status:  new
 Priority:  normal                    |    Milestone:  Unscheduled
Component:  Partitioning Systems/GPT  |      Version:  R1/Development
 Keywords:                            |   Blocked By:
 Blocking:                            |  Has a Patch:  0
 Platform:  All                       |
--------------------------------------+------------------------------
 In to_utf8(), clang warns '-Wtautological-constant-out-of-range-compare
 warnings'. I think we may increase variable 'c' size from uint16 to uint32
 at line 41.
 {{{
 /home/haiku/haiku/haiku/src/add-
 ons/kernel/partitioning_systems/gpt/utility.cpp:50:16: warning: comparison
 of constant 65536 with expression of type 'uint16' (aka 'unsigned short')
 is always true [-Wtautological-constant-out-of-range-compare]
                 } else if (c < 0x10000) {
                            ~ ^ ~~~~~~~
 /home/haiku/haiku/haiku/src/add-
 ons/kernel/partitioning_systems/gpt/utility.cpp:54:16: warning: comparison
 of constant 1114111 with expression of type 'uint16' (aka 'unsigned
 short') is always true [-Wtautological-constant-out-of-range-compare]
                 } else if (c <= 0x10ffff) {
                            ~ ^  ~~~~~~~~
 }}}

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

Other related posts: