
Originally Posted by
hagbard5
In Java or C# that code wouldn't even compile, while good old g++ doesn't even bother to give you a warning ... hope this helps.
I'm using g++ and have a warning
Code:
#include <QtCore>
QString returnString()
{
QString str = "string";
}
int main (int argc, char **argv)
{
QCoreApplication app(argc, argv);
qDebug() << returnString();
}
Code:
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o main.o main.cpp
main.cpp: In function ‘QString returnString()’:
main.cpp:6: warning: no return statement in function returning non-void
g++ -Wl,-O1 -o geo main.o -L/usr/lib -lQtGui -lQtCore -lpthread