I’d argue that’s not true. That’s what the extern keyword is for. If you do #include, you don’t get the actual printf function defined by the preprocessor. You just get an extern declaration (though extern is optional for function signatures). The preprocessed source code that is fed to cc is still not complete, and cannot be used until it is linked to an object file that defines printf. So really, the unnamed “C preprocessor output language” can access functions or values from elsewhere.
No, it can’t. The compiler can’t do anything with content from any file not explicitly passed to it. You’re mixing up the compiler and the linker (and the linker has nothing to do with either language, it can link binaries compiled from any language).
I’d argue that’s not true. That’s what the extern keyword is for. If you do
#include
, you don’t get the actualprintf
function defined by the preprocessor. You just get an extern declaration (though extern is optional for function signatures). The preprocessed source code that is fed tocc
is still not complete, and cannot be used until it is linked to an object file that definesprintf
. So really, the unnamed “C preprocessor output language” can access functions or values from elsewhere.No, it can’t. The compiler can’t do anything with content from any file not explicitly passed to it. You’re mixing up the compiler and the linker (and the linker has nothing to do with either language, it can link binaries compiled from any language).