Opened 3 years ago

Closed 3 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:
Has a Patch: yes 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 3 years ago.
0002-MailProtocol.cpp-fix-gcc6-build.patch (1.9 KB) - added by mt 3 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 3 years ago by mt

Has a Patch: set

comment:2 Changed 3 years ago by korli

Includes order should be alphabetical.

comment:3 in reply to:  2 Changed 3 years ago by mt

Replying to korli:

Includes order should be alphabetical.

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

comment:4 Changed 3 years ago by korli

Resolution: fixed
Status: newclosed

Applied in hrev50281.

Note: See TracTickets for help on using tickets.