User forums > Using Code::Blocks

Enable all compiler warnings!

(1/1)

Bud:
I use Win XP, CodeBlocks, and MinGW.
So I use GNU GCC Compiler in Win XP.
I also check the option "Enable all compiler warnings" in the settings=>configure plugins=>compiler.
I run a C code with the command "gcc -Wall a.c" using GCC 3.4.3 in Linux.
And the a.c does not have "return 0"  in main block.
Then there is a warning in Linux.
When I run a.c in CodeBlocks on Win XP, there  is no warning.
Why?
How to solve?

mandrav:
Go to "Settings/Configure plugins/Compiler", switch to the "Other" tab and select full logging for GCC.
Rebuild your project and post here the full compile log.
Also post an example main() function of what you 're talking about.

Yiannis.

PS: I tried it here and works as expected. That's why I want more info.

Anonymous:
#include <stdio.h>

int main()
{
 printf("Hello! Tom!");
}
I follow your words to do.
After I compile it in Win XP, the message shows:
------------------------
Calculating dependencies: good.cpp
Switching to target: default
mingw32-g++.exe   -Wall  -Wall -Wall   -I"C:\\MinGW\\include"  -c "good.cpp" -o ".objs\\good.o"
mingw32-g++.exe   -L"C:\\MinGW\\lib"  -o "good.exe"   -L"C:\\MinGW\\lib"  ".objs\\good.o"    
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings
------------------------
After I run it in Win XP, the message shows:
------------------------
Project   : Console application
Compiler  : GNU GCC Compiler (called directly)
Directory : C:\Program Files\CodeBlocks\sun\
--------------------------------------------------------------------------------
Process terminated with status 1 (0 minutes, 1 seconds)
0 errors, 0 warnings
------------------------
Why there is still no warning?

Navigation

[0] Message Index

Go to full version