Apparently in .c files visual studio auto generates declarations for unidentified symbols. I tried using printf() without including stdio.h, as well as calling some random asd() function and it compiled without errors, only warnings appeared that compiler assumes extern returning int. To be sure I compiled assembly output and it really had those extern declarations. Of course linking was unsuccessful.
My question is, how can I turn off this auto generation of declarations for unidentified symbols? I have some project to do and it could kinda screw me up.
This is compiler warning C4013.
http://msdn.microsoft.com/en-us/library/d3ct4kz9.aspx
You can set up your compilation command with the /we flag to treat that specific warning as an error.
http://msdn.microsoft.com/en-us/library/thxezb7y.aspx
/we n Treats as an error the compiler warning that is specified in n. For example, /we4326 flags warning number C4326 as an error.
If you want to get really conservative, you can just treat all warnings as errors. Many teams/projects consider this a best practice.
/WX Treats all compiler warnings as errors. For a new project, it may be best to use /WX in all compilations; resolving all warnings will ensure the fewest possible hard-to-find code defects. The linker also has a /WX option. See /WX (Treat Linker Warnings as Errors) for more information.