[haiku-bugs] [Haiku] #12747: [Patch] InfoWindow.cpp: fix gcc6 build

  • From: "mt" <trac@xxxxxxxxxxxx>
  • Date: Thu, 05 May 2016 11:01:30 -0000

#12747: [Patch] InfoWindow.cpp: fix gcc6 build
--------------------------------+------------------------------
 Reporter:  mt                  |        Owner:  nobody
     Type:  bug                 |       Status:  new
 Priority:  normal              |    Milestone:  Unscheduled
Component:  Kits/libtracker.so  |      Version:  R1/Development
 Keywords:                      |   Blocked By:
 Blocking:                      |  Has a Patch:  0
 Platform:  All                 |
--------------------------------+------------------------------
 Gcc6 warns '-Werror=misleading-indentation' in
 BInfoWindow::MessageReceived() and AttributeView::MouseDown(), so add
 curly braces to fix it. and I think we don't need ";" after if() at line
 453 and line 1258.

 {{{
 C++ /home/haiku/haiku/haiku/generated-
 gcc6/objects/haiku/x86/release/kits/tracker/InfoWindow.o
 /home/haiku/haiku/haiku/src/kits/tracker/InfoWindow.cpp: In member
 function 'virtual void BPrivate::BInfoWindow::MessageReceived(BMessage*)':
 /home/haiku/haiku/haiku/src/kits/tracker/InfoWindow.cpp:444:4: error: this
 'if' clause does not guard... [-Werror=misleading-indentation]
     if (!fModel->HasLocalizedName()
     ^~
 /home/haiku/haiku/haiku/src/kits/tracker/InfoWindow.cpp:454:5: note:
 ...this statement, but the latter is misleadingly indented as if it is
 guarded by the 'if'
      fAttributeView->BeginEditingTitle();
      ^~~~~~~~~~~~~~
 /home/haiku/haiku/haiku/src/kits/tracker/InfoWindow.cpp: In member
 function 'virtual void BPrivate::AttributeView::MouseDown(BPoint)':
 /home/haiku/haiku/haiku/src/kits/tracker/InfoWindow.cpp:1248:3: error:
 this 'if' clause does not guard... [-Werror=misleading-indentation]
    if (!fModel->HasLocalizedName()
    ^~
 /home/haiku/haiku/haiku/src/kits/tracker/InfoWindow.cpp:1259:4: note:
 ...this statement, but the latter is misleadingly indented as if it is
 guarded by the 'if'
     BeginEditingTitle();
     ^~~~~~~~~~~~~~~~~
 cc1plus: all warnings being treated as errors
 }}}

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

Other related posts: