User forums > Using Code::Blocks
Listing warnings
zabzonk:
See http://imgur.com/3e9hQ
I suppose you have enabled -Wall in the CB project settings?
smallB:
Hi Neil, yes, I have it set. The output from a program (in cb in build log tab):
--- Code: ---int f()
{
}
int main()
{
f();
}
--- End code ---
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)
zabzonk:
If your code compiled with warnings, but with zero errors, it is not by default re-built the next time you hit "run", so you won't see the warnings a second time. To see the warnings again, you need to explicitly rebuild. The stuff in the build-log is from the last compilation.
smallB:
Neil, thanks, indeed rebuild does the trick.
Navigation
[0] Message Index
[*] Previous page
Go to full version