Bug 180954 - Failed to compile kdepim - include/conversion_check.h:60: error: conversion from 'ConversionCheck::unsupported' to non-scalar type 'ConversionCheck::supported' requested
Summary: Failed to compile kdepim - include/conversion_check.h:60: error: conversion f...
Status: CLOSED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Solaris
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-16 11:48 UTC by Yevgeniy
Modified: 2009-06-15 12:23 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yevgeniy 2009-01-16 11:48:04 UTC
Version:            (using KDE 4.1.3)
Compiler:          GNU gcc 4.3.2 
OS:                Solaris
Installed from:    Compiled From Sources

When compiling kdepim-4.1.4 (with kdelibs-4.1.4)
I get the following error:

[ 47%] Building CXX object kmail/CMakeFiles/kmailprivate.dir/kmstartup.o
/opt/kde4/include/conversion_check.h: In member function 'void ConversionCheck::type_toQVariant<T>::constraint() [with T = long int]':
/opt/kde4/include/conversion_check.h:78:   instantiated from 'void ConversionCheck::to_QVariant() [with T = long int]'
/opt/kde4/include/kconfiggroup.h:673:   instantiated from 'void KConfigGroup::writeCheck(const char*, const T&, QFlags<KConfigBase::WriteConfigFlag>) [with T = long int]'
/opt/kde4/include/kconfiggroup.h:374:   instantiated from 'void KConfigGroup::writeEntry(const char*, const T&, QFlags<KConfigBase::WriteConfigFlag>) [with T = pid_t]'
/home/unix/kdepim-4.1.4/kmail/kmstartup.cpp:234:   instantiated from here
/opt/kde4/include/conversion_check.h:60: error: conversion from 'ConversionCheck::unsupported' to non-scalar type 'Conver
sionCheck::supported' requested


I got around this error by adding the following line:
QVConversions(long int, supported, supported);
to the file include/conversion_check.h (this file from kdelibs-4.1.4)


OS: SunOS 5.11 snv_104 i86pc i386 i86pc Solaris
compiler: gcc 4.3.2
linker: GNU ld (GNU Binutils) 2.18
Comment 1 groot 2009-01-16 15:16:29 UTC
There's two ways to go about this; either adding a conversion for long (int and long long are supported already) or casting the result of getpid() to long long. The definition of pid_t is conditional on #if defined(_LP64) || defined(_I32LPx). I think the first thing to check is if long *is* supported by QVariant and just isn';t listed by accident - then we can fix the conversions header.

The KDE4-Solaris team has hit this problem previously and has picked (long long) cast as the easy fix up until now.
Comment 2 Oswald Buddenhagen 2009-01-18 10:24:47 UTC
qvariant does not support long, as it would cause ambiguities. fix with a cast in kmail.
Comment 3 Allen Winter 2009-06-12 22:53:19 UTC
has this been taken care of by now?
can we close?
Comment 4 Allen Winter 2009-06-13 15:10:10 UTC
SVN commit 981380 by winterz:

cast getpid() to a qlonglong so we don't rely on a system include to give us
a type that QVariant can't handle.

Should fix compile problems on systems where getpid() is a long.

BUG: 180954


 M  +3 -2      kmstartup.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=981380