QVariant debugging
Thomas Braxton
brax108 at cox.net
Fri Dec 23 22:43:10 GMT 2005
On Friday 23 December 2005 02:57, David Faure wrote:
> On Friday 23 December 2005 05:32, Thomas Braxton wrote:
> > I'm trying to debug why KConfigBase::readEntry(key, bool) is ambiguous,
> > but I think I may have found a bug in either g++ or Qt. I want to be sure
> > it is not something I'm doing, so could someone look at this code and see
> > if everything looks good. If it is could you compile it and see if it
> > segfaults for you. It segfaults for me when destroying the
> > QVariant(bool), it looks like it gets confused on what the type is so it
> > tries to delete a non-existant pointer.
>
> The test program is buggy:
> readentry.cpp: In member function `QString KConfigBase::readEntry(const
> char*, const QString&) const': readentry.cpp:32: warning: control reaches
> end of non-void function readentry.cpp: In member function `QVariant
> KConfigBase::readEntry(const char*, const QVariant&) const':
> readentry.cpp:43: warning: control reaches end of non-void function
>
> After fixing those warning, e.g. adding "return QString();" from those two
> places, the test program doesn't crash anymore (and is valgrind-clean).
Thanks, I don't know how I missed that. Now to figure out why it picks
readEntry(key, QString) for test2 & test4.
More information about the kde-core-devel
mailing list