Opened 9 years ago

Closed 9 years ago

#12743 closed bug (fixed)

[Patch] MailProtocol.cpp: fix gcc6 build

Reported by: mt Owned by: czeidler
Priority: normal Milestone: Unscheduled
Component: Kits/Mail Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

Gcc6 warns '-Werror=nonnull-compare' in some functions. It seems it is better to use BAutolock(this) than Blocker(this).

C++ /home/haiku/haiku/haiku/generated-gcc6/objects/haiku/x86/release/kits/mail/ssl/MailProtocol.o 
/home/haiku/haiku/haiku/src/kits/mail/MailProtocol.cpp: In member function 'bool BMailProtocol::AddFilter(BMailFilter*)':
/home/haiku/haiku/haiku/src/kits/mail/MailProtocol.cpp:91:21: error: nonnull argument 'this' compared to NULL [-Werror=nonnull-compare]
  BLocker locker(this);
                     ^
/home/haiku/haiku/haiku/src/kits/mail/MailProtocol.cpp: In member function 'int32 BMailProtocol::CountFilter() const':
/home/haiku/haiku/haiku/src/kits/mail/MailProtocol.cpp:99:21: error: nonnull argument 'this' compared to NULL [-Werror=nonnull-compare]
  BLocker locker(this);
                     ^
/home/haiku/haiku/haiku/src/kits/mail/MailProtocol.cpp: In member function 'BMailFilter* BMailProtocol::FilterAt(int32) const':
/home/haiku/haiku/haiku/src/kits/mail/MailProtocol.cpp:107:21: error: nonnull argument 'this' compared to NULL [-Werror=nonnull-compare]
  BLocker locker(this);
                     ^
/home/haiku/haiku/haiku/src/kits/mail/MailProtocol.cpp: In member function 'BMailFilter* BMailProtocol::RemoveFilter(int32)':
/home/haiku/haiku/haiku/src/kits/mail/MailProtocol.cpp:115:21: error: nonnull argument 'this' compared to NULL [-Werror=nonnull-compare]
  BLocker locker(this);
                     ^
/home/haiku/haiku/haiku/src/kits/mail/MailProtocol.cpp: In member function 'bool BMailProtocol::RemoveFilter(BMailFilter*)':
/home/haiku/haiku/haiku/src/kits/mail/MailProtocol.cpp:123:21: error: nonnull argument 'this' compared to NULL [-Werror=nonnull-compare]
  BLocker locker(this);
                     ^
cc1plus: all warnings being treated as errors

Attachments (2)

0004-MailProtocol.cpp-fix-gcc6-build.patch (1.8 KB ) - added by mt 9 years ago.
0002-MailProtocol.cpp-fix-gcc6-build.patch (1.9 KB ) - added by mt 9 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by mt, 9 years ago

patch: 01

comment:2 by korli, 9 years ago

Includes order should be alphabetical.

in reply to:  2 comment:3 by mt, 9 years ago

Replying to korli:

Includes order should be alphabetical.

Hi korli, I sorted headers and add name to BAutolocks.

comment:4 by korli, 9 years ago

Resolution: fixed
Status: newclosed

Applied in hrev50281.

Note: See TracTickets for help on using tickets.