In this code: //Load a style icon as a pixmap QPixmap loadImagePixmap(const QString& fileName) { for (int i = 0; i < cacheOfPixmaps.size(); ++i) { if(ScacheOfPixmaps.at(i)==fileName) return cacheOfPixmaps.at(i); } QString fullPath=loadFilePathIntheStyle(fileName); if(!QFile::exists(fullPath)) { return QPixmap(); DEBUGCONSOLE(10,"loadImagePixmap",fileName+" not found."); } else { QPixmap theReturnedImage(fullPath); if(theReturnedImage.isNull()) { DEBUGCONSOLE(10,"loadImagePixmap",fileName+" can't be opened."); } else { cacheOfPixmaps.append(theReturnedImage); ScacheOfPixmaps.append(fileName); } return theReturnedImage; } } It's say me: main.cpp: In function 'QPixmap loadImagePixmap(const QString&)': main.cpp:313: warning: control reaches end of non-void function It's wrong because need always return a value.
-- Summary: Wrong warning with control reaches end of non-void function Product: gcc Version: 4.3.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: alpha dot super-one at laposte dot net GCC host triplet: linux x86_64 GCC target triplet: linux x86_64 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39191