Keeping blank lines in C++ preproccessor output
Ian Lance Taylor
iant@google.com
Sun Jan 8 01:02:00 GMT 2012
<galexander2@nc.rr.com> writes:
> I'm using the C++ preprocessor (g++ -E) to partially preprocess a C++ header file. The preprocessor output documentation (http://gcc.gnu.org/onlinedocs/gcc-4.6.2/cpp/Preprocessor-Output.html#Preprocessor-Output) states:
>
> Long runs of blank lines are discarded.
>
> Rather than have long runs of blank lines discarded, I would prefer that runs of two or more blank lines be replaced by single blank line or be left as is. Does anyone know of a way to accomplish either of these?
As far as I know there is no way to do this (other than modifying the
preprocessor code). It would not be too hard to write a postprocessor
which looked at the #line statements and recreated the blank lines.
Ian
More information about the Gcc-help
mailing list