Is there a way to "preprocess" C99-style digraphs to obtain a C file (or a .i
preprocessed source) such that the resulting file does not contain any digraphs?
For instance, given the following source code:
%:define N 5
int main() <%
int a<:N:> = <%2,1,0%>;
char *s = "a<:b";
return a<:4:>;
%>
Using GCC's preprocessor option (-E
, plus -dD
for good measure) is sufficient to get rid of the %:
digraph (which gets evaluated and re-printed as #define
in this example), but not the others.
Clang behaves in the same way, so it doesn't help much.
As far as I understand, simple regular expression substitutions would not work, since they would end up replacing occurrences inside strings.