Bug 363053

Summary: Building kopete-16.04.0 with GCC-6.1.0 fails with "error: could not convert 'false' from 'bool' to 'const Kopete::MetaContact*'"
Product: [Applications] kopete Reporter: nsane457
Component: History PluginAssignee: Kopete Developers <kopete-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: johu, kensington, lbeltrame, nsane457
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 16.04.2
Attachments: kopete-16.04.0-gcc6.patch
kopete-16.04.0-gcc6.patch

Description nsane457 2016-05-14 02:50:05 UTC
Building kopete-16.04.0 with GCC-6.1.0 fails with:

In file included from /var/tmp/portage/kde-apps/kopete-16.04.0/work/kopete-16.04.0/plugins/history2/history2logger.cpp:19:0:
/var/tmp/portage/kde-apps/kopete-16.04.0/work/kopete-16.04.0/plugins/history2/history2logger.h:97:81: error: could not convert 'false' from 'bool' to 'const Kopete::MetaContact*'
                                      int offset=0, const Kopete::MetaContact *c=false, bool reverseOrder=true);


With gcc-6, only integer literals can be used as null pointer constants (see https://gcc.gnu.org/gcc-6/porting_to.html).

Reproducible: Always

Steps to Reproduce:
1. emerge -p =kde-apps/kopete-16.04.0


Actual Results:  
In file included from /var/tmp/portage/kde-apps/kopete-16.04.0/work/kopete-16.04.0/plugins/history2/history2logger.cpp:19:0:
/var/tmp/portage/kde-apps/kopete-16.04.0/work/kopete-16.04.0/plugins/history2/history2logger.h:97:81: error: could not convert 'false' from 'bool' to 'const Kopete::MetaContact*'
                                      int offset=0, const Kopete::MetaContact *c=false, bool reverseOrder=true);

Expected Results:  
Successful merge
Comment 1 nsane457 2016-05-14 02:52:39 UTC
Created attachment 98951 [details]
kopete-16.04.0-gcc6.patch

Changes "const Kopete::MetaContact *c=false" to "const Kopete::MetaContact *c=nullptr".
Comment 2 nsane457 2016-05-16 05:39:01 UTC
Created attachment 99003 [details]
kopete-16.04.0-gcc6.patch

nullptr is not  available for gnu++98 but NULL works fine for gnu++98 and gnu++14
Comment 3 Luca Beltrame 2016-05-24 11:12:11 UTC
Please submit this patch through reviewboard.kde.org if possible. Patches through Bugzilla are likely to get lost.
Comment 4 nsane457 2016-05-24 17:11:25 UTC
(In reply to Luca Beltrame from comment #3)
> Please submit this patch through reviewboard.kde.org if possible. Patches
> through Bugzilla are likely to get lost.

Done:

https://git.reviewboard.kde.org/r/128006/
Comment 5 Pali Rohár 2016-05-31 15:43:58 UTC
Git commit 9f994ba6950117cbbeefc6027fa0a52ce74932e2 by Pali Rohár, on behalf of Peter Levine.
Committed on 31/05/2016 at 15:40.
Pushed by pali into branch 'Applications/16.04'.

Fix compilation with GCC 6

REVIEW: 128006
FIXED-IN: 16.04.2

M  +1    -1    plugins/history2/history2logger.h

http://commits.kde.org/kopete/9f994ba6950117cbbeefc6027fa0a52ce74932e2