[haiku-bugs] [Haiku] #12767: [Patch] ringqueue.cpp: fix gcc6 build

  • From: "mt" <trac@xxxxxxxxxxxx>
  • Date: Mon, 09 May 2016 02:31:23 -0000

#12767: [Patch] ringqueue.cpp: fix gcc6 build
----------------------------------------+------------------------------
 Reporter:  mt                          |        Owner:  kallisti5
     Type:  bug                         |       Status:  new
 Priority:  normal                      |    Milestone:  Unscheduled
Component:  Drivers/Graphics/radeon_hd  |      Version:  R1/Development
 Keywords:  accelerants/radeon_hd       |   Blocked By:
 Blocking:                              |  Has a Patch:  0
 Platform:  All                         |
----------------------------------------+------------------------------
 In compute_order(), gcc6 warns '-Werror=misleading-indentation', but I
 think if() at line 40 is not in for() block. So I separate for() and if().

 {{{
 C++ /home/haiku/haiku/haiku/generated-gcc6/objects/haiku/x86/release/add-
 ons/accelerants/radeon_hd/ringqueue.o
 /home/haiku/haiku/haiku/src/add-ons/accelerants/radeon_hd/ringqueue.cpp:
 In function 'int compute_order(long unsigned int)':
 /home/haiku/haiku/haiku/src/add-
 ons/accelerants/radeon_hd/ringqueue.cpp:39:2: error: this 'for' clause
 does not guard... [-Werror=misleading-indentation]
   for (order = 0, tmp = size; tmp >>= 1; ++order);
   ^~~
 /home/haiku/haiku/haiku/src/add-
 ons/accelerants/radeon_hd/ringqueue.cpp:40:3: note: ...this statement, but
 the latter is misleadingly indented as if it is guarded by the 'for'
    if (size & ~(1 << order))
    ^~
 cc1plus: all warnings being treated as errors
 }}}

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

Other related posts: