Whether printf() is a builtin or not, it still requires the prototype: #include <stdio.h> is needed or I get an error on mingw.
Really? :)
D:\desktop>echo main(){printf("blah");} > test.c
D:\desktop>gcc test.c -o test.exe
D:\desktop>test.exe
blah
D:\desktop>
You're both right, sort of:
D:\Temp> echo main(){printf("blah");} > test.c
D:\Temp> gcc -o test.exe test.c
D:\Temp> test
blah
D:\Temp> echo main(){printf("blah");} > test.cpp
D:\Temp> g++ -o test2.exe test.cpp
test.cpp: In function `int main()':
test.cpp:1: error: `printf' undeclared (first use this function)
test.cpp:1: error: (Each undeclared identifier is reported only once for each function it appears in.)
D:\Temp>
So it'll work in C, but not in C++. C++ always requires prototypes/definitions, C just assumes that the parameter types are the types of what was passed and that it returns int if no prototype/definition is given (though GCC will warn about it if -Wall is passed).
However, since this thread was about C (Pelles C doesn't support C++) thomas is more right.
This is one of the things I dislike most about C.
-Wall, never compile C without it ;).