Thanks Neil, but this doesn't work - not in this scenario anyway:
int f()
{
}
int main()
{
f();
return 0;
}
This with -Wall will emit a warning about no return statement, but ONLY visible in build log.html.
Hi Neil, yes, I have it set. The output from a program (in cb in build log tab):
int f()
{
}
int main()
{
f();
}
is:
Checking for existence: C:\c++ excercizes\no_return\bin\Debug\no_return.exe
Executing: "E:\downloads\codeblocks\Nightly\oct_2011\CB_20111030_rev7550_DEBUGGER_BRANCH_win32/cb_console_runner.exe" "C:\c++ excercizes\no_return\bin\Debug\no_return.exe" (in C:\c++ excercizes\no_return\.)
Process terminated with status 0 (0 minutes, 2 seconds)
In the file build.log.html:
Build started on: 01-11-2011 at 09:08.37
Build ended on: 01-11-2011 at 09:08.42
-------------- Build: Debug in no_return ---------------
g++ -std=c++0x -Wfatal-errors -Wextra -Wall -fexceptions -g -std=c++0x -Wfatal-errors -Wextra -Wall -g -Wreorder -ID:\Libraries\boost_1_47_0\boost_1_47_0 -ID:\Libraries\Art_lib -I"C:\c++ excercizes\no_return" -I"C:\c++ excercizes\no_return" -c "C:\c++ excercizes\no_return\main.cpp" -o obj\Debug\main.o
C:\c++ excercizes\no_return\main.cpp: In function 'int f()':
C:\c++ excercizes\no_return\main.cpp:7:1: warning: no return statement in function returning non-void [-Wreturn-type]
mingw32-g++.exe -LC:\boost_1_47_0 -LC:\Qt\4.8.0\bin -o bin\Debug\no_return.exe obj\Debug\main.o
Output size is 57.41 KB
Process terminated with status 0 (0 minutes, 4 seconds)
0 errors, 1 warnings (0 minutes, 4 seconds)