I'm in the process of porting a lot of code originally written for the C51 compiler. The code makes extensive use of the "##" token-pasting feature. Explanation: http://www.keil.com/support/man/docs/c51/c51_pp_tokenpastingop.htm
How can I use token pasting (or a similar feature) with armcc 5.06? I'm using Keil MDK 5.28 for an STM32 target device.
Thank you so much, Ed! This feature works just fine - it just doesn't seem to have any accompanying documentation about token pasting like most of the compiler documentation I've looked at (C51, C166, GCC, etc).
On a side note, not all compilers handle token pasting the same way (for ambiguous cases): https://complete-concrete-concise.com/programming/c/preprocessor-the-token-pasting-operator/
As far as I can tell (at least with --no_strict option), the armcc 5 compiler handles the example ambiguous case like Visual C++ (re-processing) rather than GCC (rejecting with error).
The specific task is hard to describe, but it relies heavily on token pasting to automatically generate functions (and their prototypes) to convert simple, high level commands into complex, low level code. This is done in the OS and makes life much easier for application programmers.