▲ | quietbritishjim 4 days ago | ||||||||||||||||
> The "project" is all the files going into a program supplied other than by the implementation. Most of my most recent comment is addressing the possibility that you meant this. As I said, there is no such concept to the compiler. It isn't passed any list of files that could be included with #includr, only the .c files actually being compiled, and the directories containing includable files. The fact that your IDE shows project files is an illusion. Any header files shown there are not treated differently by the compiler/preprocessor to any others. They can't be, because it's not told about them! It's even possible to add header files to your IDE's project that are not in the include path, and then they wouldn't be picked up by #include. That's how irrelevant project files are to #include. | |||||||||||||||||
▲ | kazinator 4 days ago | parent [-] | ||||||||||||||||
There is no "compiler", "IDE" or "include path" in the wording of the ISO C standard. A set of files is somehow presented to the implementation in a way that is not specified. Needless to say, a file that is included like "globals.h" but is not the base file of a translation unit will not be indicated to the implementation as the base of a translation unit. Nevertheless it has to be somehow present, if it is required. It doesn't seem as if you're engaging with the standard-based point I've been making, in spite of detailed elaboration. > Any header files shown there are not treated differently by the compiler/preprocessor to any others. This is absolutely false. Headers which are part of the implementation, such as standard-defined headers like <stdlib.h> need not be implemented as files. When the implementation processes #include <stdlib.h>, it just has to flip an internal switch which makes certain identifiers appear in their respective scopes as required. For that reason, if an implementation provides <winkle.h>, there need not be such a file anywhere in its installation. | |||||||||||||||||
|