Since the times of Stone Age the C standard includes so-called "trigraphs", to fill the gap of missing some characters ('#', '[', ']', '{', '}', '\', '|', '~', '^') in some very limited character sets. They could be coded by those trigraphs, f.e. '#' as '??='
I am not sure if anybody (resp. any character set / keyboard / compiler) yet needs these trigraphs, I just stumbled over that by setting a test string within a modules *.cfg file:
Log.text = "Now it works... (???)";
Afterwards the compiler found the trigraph '??)' and warned about:
warning: trigraph ??) ignored, use -trigraphs to enable
So I changed my text to that
Log.text = "Now it works... (?\?\?)";
But again the C file generated by XDC contains the string "Now it works... (???)"
, about which again the compiler warns.
Of course, I could have suppressed this warning without any serious consequences.
But felt like that might be a small (design) error within the string handling of XDC. Shouldn't XDC give attention to this small, old element of the C standard, maybe with respect to the chosen compiler behaviour? Or , at least, leave the '\?' unchainged?
I wrote '\\?' within the config, this is translated to '\?' within the generated C file, and, now came the big surprise for me, consistently it translated '\n' to a simple line break (without closing '\' for line change) within the string at the C file, which, of course, produces an compiler error.
Now, is it somewhere written down that those signs started with '\' are translated by the XDC framework when generating C files from that, and that thatswhy f.e. a '\n' must be coded there as '\\'? AND, ist that behaviour really wanted?
Best regards,
Joern.