▲ | kazinator 4 days ago | |||||||||||||||||||||||||||||||||||||||||||
I see what you are getting at. Programs consist of materials that are presented to the implementation, and also of materials that come from the implementation. So what I mean is that no file matching <winkle.h> has been presented as part of the external file set given to the implementation for processsing. I agree that if such a file is found by the implementation it becomes part of the program, as makes sese and as that word is defined by ISO C, so it is not right terminology to say that the file is not part of the program, yet may be found. If the inclusion is successful, though, the content of that portion of that program is not defined by ISO C. | ||||||||||||||||||||||||||||||||||||||||||||
▲ | quietbritishjim 4 days ago | parent [-] | |||||||||||||||||||||||||||||||||||||||||||
It still seems like you have invented some notion of "program" that doesn't really exist. Most suspicious is when you say this: > So what I mean is that no file matching <winkle.h> has been presented as part of the external file set given to the implementation for processsing. The thing is, there is no "external file set" that includes header files, so this sentence makes no sense. Note that when the preprocessor is run, the only inputs are the file being preprocessed (i.e., the .c file) and the list of directories to find include files (called the include path). That's not really part of the ISO standard, but it's almost universal in practice. Then the output of the preprocessor is passed to the compiler, and now it's all one flat file so there isn't even a concept of included files at this point. The object files from compilation are then passed to the linker, which again doesn't care about headers (or indeed the top-level source files). There are more details in practice (especially with libraries) but that's the essence. I wonder if your confusion is based on seeing header files in some sort of project-like structure in an IDE (like Visual Studio). But those are just there for ease of editing - the compiler (/preprocessor) doesn't know or care which header files are in your IDE's project, it only cares about the directories in the include path. The same applies to CMake targets: you can add include files with target_sources(), but that's just to make them show up in any generated IDE projects; it has no effect on compilation. Or are you just maybe saying that the developer's file system isn't part of the ISO C standard, so this whole textual inclusion process is by some meaning not defined by the standard? If so, I don't think that matches the conventional meaning of undefined behaviour. If it's neither of those, could you clarify what exactly you mean by "the external file set given to the implementation for processing"? | ||||||||||||||||||||||||||||||||||||||||||||
|