Bug #19201 2013-11-15 09:20

akjlucky4all

Unexpected C code success

While running the following code in a file named test.c on Code::Blocks version 12.11:

#include <stdio.h>

int main()

{

display();

return 0;

}

void display()

{

printf("\nHi");

}

I am getting no error while on GCC 4.8.2, it says:

dec.c:9: warning: conflicting types for ‘display’

dec.c:5: note: previous implicit declaration of ‘display’ was here

Something is messed up in C code compilation as it is not affirming to C99 Standard.

Category
Compiler
Group
Platform:Windows
Status
Open
Close date
 
Assigned to
 
ollydbg 2013-11-17 15:11

So, what is the bug?

What is the expect result?

akjlucky4all 2013-11-18 01:34

I am getting no such warning in Code::Blocks as shown by GCC for the above mentioned code.The compiler should show such warning on compilation.

tpetrov 2013-12-22 19:52

So the problem is that you're not seeing the warning in the "Build log" or "Build messages" panels?

Keep in mind that C::B is not a compiler, but an IDE using a compiler available on your system!

mercury13 2014-01-13 13:54

Strange, everything’s right, two messages (though I use 13.12 with manually-installed MinGW 4.8.2).

mercury13 2014-01-13 14:04

Maybe, check for warning settings?