Hello,
It seems that chibicc currently does not process #include directives properly if the macro is undefined.
The C standard says, to quote ISO/IEC 9899:1999:
A preprocessing directive of the form # include pp-tokens new-line (that does not match one of the two previous forms) is permitted. The preprocessing tokens after include in the directive are processed just as in normal text. (Each identifier currently defined as a macro name is replaced by its replacement list of preprocessing tokens.) The directive resulting after all replacements shall match one of the two previous forms. The method by which a sequence of preprocessing tokens between a < and a > preprocessing token pair or a pair of " characters is combined into a single header name preprocessing token is implementation-defined.
For example the following:
expected error message by the standard (which gcc and clang conforms to) is:
error: #include expects "FILENAME" or <FILENAME>
#include UNDEFINED
Hello,
It seems that chibicc currently does not process #include directives properly if the macro is undefined.
The C standard says, to quote ISO/IEC 9899:1999:
For example the following:
expected error message by the standard (which gcc and clang conforms to) is: