what kind of weird behaviour is this???
#include "stdafx.h"< br />
// what is up?
int foo(int bar)
{
bla bla bla?????
return bar ;
}
and more junk???
What does the compiler do in the world to allow the code to be compiled without giving any error messages? I am using Visual Studio 2008, which is unmanaged C code. The foo function is not actually generated in the object file, so it cannot be used, but why is there no error?
However, if the following syntax error code does not produce an error, then it is very likely that your file has not been compiled at all.
I noticed today that the source code file in the project is working Compile, even if it has garbage on the top. It makes me wonder if the compiler will pass through without errors. The following is a code example that does not generate any error messages:
< pre>what kind of weird behaviour is this???
#include “stdafx.h”
// what is up?
int foo(int bar)
{
bla bla bla?????
return bar;
}
and more junk??? pre>
What does the compiler do in the world to allow the code to be compiled without giving any error messages? I am using Visual Studio 2008, which is unmanaged C code. The foo function is not actually generated in the object file, so it cannot be used, but why is there no error?
The part before the #include “stdafx.h” line is actually interpretable (assuming the file is actually compiled): if precompiled header files are enabled (By default), everything before and after the line is ignored. For a short summary, see Wikipedia on Precompiled Headers.
However, if you include the following syntax error code, no error is generated , Then it is very likely that your file is not compiled at all.