Some time back I extended GCC's '# NNN' line marker semantics. Specifically popping to a blank filename will restore the filename to that of the popped-to include.
E.g. restore to line 5 of including file (escaped BOL #'s to avoid git eliding them):
\# 5 "" 2
GCC already had no documentation for this directive extension, I did not add any.
This was useful in developing modules tests, but turned out to also be useful with machine-generated source code. Specifically, a generated include file that itself includes fragments from elsewhere. The ability to pop to the generated include file -- with its full path prefix -- is useful for diagnostic & debug purposes. For instance something like:
Machine generated -- DO NOT EDIT
Type Var = {
\# 7 "encoded.dsl" 1 push to snippet-container
{snippet, of, code}
\# 6 " 2 // Restore to machined-generated source
,
};
// user-code
...
\#include "dsl.h"
...
That pop to "" will restore the filename to '..includepath../dsl.h', which is better than restoring to plain "dsl.h".
clang-format: please reformat the code