Bug 284720

Summary: build fails with error
Product: [Applications] digikam Reporter: Thomas Caswell <tcaswell>
Component: Portability-CompilationAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, vivo75+kde
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 2.3.0
Sentry Crash Report:

Description Thomas Caswell 2011-10-22 17:57:42 UTC
Version:           unspecified (using KDE 4.7.1) 
OS:                Linux

~/digikam-sc/core/libs/dmetadata/dmetadata.cpp: In static member function ‘static QString Digikam::DMetadata::valueToString(const QVariant&, Digikam::MetadataInfo::Field)’:
~/digikam-sc/core/libs/dmetadata/dmetadata.cpp:2410:1: error: control reaches end of non-void function [-Werror=return-type]
cc1plus: some warnings being treated as error


tcaswell@eowyn:~/other_source/digikam-sc$ g++ --version
g++ (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1


It seems that the compiler does not agree that the default case will keep the program from getting out of the switch statement without returning.  Adding the default return after the switch allows the code compile

Reproducible: Always

Steps to Reproduce:
update to head of master branch

Actual Results:  
-

Expected Results:  
-
Comment 1 Christoph Feck 2011-10-22 19:06:04 UTC
Stupid compiler, but I guess there is no choice to add the redundant "return QString();"
Comment 2 caulier.gilles 2011-10-23 05:36:04 UTC
Which version do you compile ? Git/master ?

Gilles Caulier
Comment 3 Francesco Riosa 2011-10-23 11:55:21 UTC
(In reply to comment #2)
> Which version do you compile ? Git/master ?
> 
> Gilles Caulier

it's a gcc-4.6 warning, threathed like error,
http://commits.kde.org/digikam/5bf4ba612516d2c15d4e6659f9653ae574735ace

I've adopted the same solution as Christoph Feck #c1 in sql2.0 branch, should I cherry pick it to master?
Comment 4 caulier.gilles 2011-10-23 12:11:13 UTC
yes, sure backport it and close this entry (:=)))
Comment 5 Francesco Riosa 2011-10-23 15:49:56 UTC
done