We want to use the preprocessor output file (.i
file ) for further use, especially the comments.
For that, we use the /PREPRINT
(or /PP
) command line switch.
The problem is that the KEIL compiler (C166) deletes any comments.
Q: Is it possible to keep comments in the .i
file?
Additional research:
The Microsoft compiler does this with the /P
command line switch.
But they has /C
to keep comments.
You can use
gcc -E -CC file.c
It keeps all the comments, including the ones in the .h files that may have been included by C file.
I turns out that the C166 Keil compiler supports also the /C
compiler switch. This switch is not available through the IDE and is not documented.
To use it, we had to write a batch file that contains the /C
switch and run the compiler a second time to create the .i
file.
It also turns out that all of the compilers we use has this switch (Mircosoft, and as Arun Taylor mentioned, the GCC compiler). So we are able to use the commented .i
file from every compiler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With