[Cpip-develop] #line and #pragma issues
Status: Alpha
Brought to you by:
cpip
From: Bengt G. <Ben...@co...> - 2015-01-15 15:50:36
|
Hi! I am using the cpip module in a situation where I need to first preprocess, then massage the preprocessed code a bit and finally send the resulting source code off to the "real" compiler. The cpip module was really easy to get working but I have two problems, listed below. One is that the original source code contains #pragma directives. I want these to go right through the preprocessing. While it is possible to install a pragma handler it does not seem to be possible to avoid an endless loop if I just send the pragma back to the source stream. I would like a possibility to block further preprocessing of whatever the pragma() function returns. Alternatively and simpler in my case another callback, say keep() which if it exists and returns true moves the entire pragma line to the output stream automatically. Another problem is that if I get an error in the final compilation step I won't know what the original line number is or which include file a particular line comes from. With other preprocessors the output stream is usually filled with #line directives which the compiler uses to make sure error messages are appointed to the right line in the original source even if the preprocessor is run as a separate step. I would like an option to generate #line directives in the output file! Best Regards, Bengt Gustafsson |