   VC automatic headers
  When you use some common functions like fread there is no need to include the header (stdio.h in this case) which is bad when you try to write compatible source code. Is there any way to turn off these "automatic headers" in VC?   
  Does your project use precompiled headers? The Visual C++ IDE may set up an stdafx.h header for precompilation on your behalf, depending on the settings you selected when creating the project. Check the contents of this header. You may want to remove it entirely if you're really against PCH. Other precompiled headers may be in your project if it's an existing code base.Most compilers (MSVC included) support "forced includes", where you can tell the compiler to always #include a header at the beginning of the preprocessing stage. It's possible that cstdio or stdio.h is being force-included. This will likely be buried in the project options somewhere. Look for the /FI switch.If none of this is ringing true, can you provide a little more information?   ;Quote:Original post by FeidiasWhen you use some common functions like fread there is no need to include the header (stdio.h in this case) which is bad when you try to write compatible source code. Is there any way to turn off these "automatic headers" in VC?No standard usage of VS should cause it to include a header file in a TU without you explicitly using the #include directive to bring that header in, or to bring in a header that itself directly or indirectly includes that header.   ;  MSVC does automatically includes a number of symbols that don't require any headers. For example, this will compile under MSVC 2008:int main(int, char **) {  size_t s = sizeof(__s_GUID);}without any includes despite the fact that size_t is supposed to be defined in cstddef and __s_GUID being another symbol that has no declaration. AFAIK, there's no way to disable this behavior.   ;  There is also the /FI compiler option (accessible from C/C++ -> Advanced project options), which forces MSVC to include the specified headers at the top of every source file.  We have a file called "Always.h" at work that should, well, always be included first and we use this option to ensure that it is.   ;  Also, Windows.h includes a bunch of C headers, if you have that in your project maybe it's from there.   