I recently found out gcc skips preprocessing if file ending is .i or .ii and decided to give it a go. Compiling a hello world program without including stdio.h:
gcc -Wall file.c; # compiles with preprocessor, implicit declaration of puts
gcc -Wall file.i; # compiles without preprocessor, implicit declaration of puts
I can't include stdio.h without a preprocessor directive, but I remember the -include flag to gcc can be used to "force include" headers. It led to following test:
gcc -Wall -include stdio.h file.c; # no warnings, "hello world". hooray
gcc -Wall -include stdio.h file.i; # implicit declaration of puts WAIT WHAT?!
I find it odd how gcc does not include stdio.h if compiling a file without preprocessing. Even odder how no warning is emitted; the -include stdio.h has no apparent effect, which is erroneous use of gcc at best.
Why is it not working?
GCC version 6.3.0.