shevek / jcpp

The C Preprocessor as a Java library
http://www.anarres.org/projects/jcpp/
Apache License 2.0
106 stars 36 forks source link

skip empty LN with # instead of filling LN #39

Open gapkalov opened 4 years ago

gapkalov commented 4 years ago

gcc pack more than six sequent empty line into one line with using of # directive like this one:

before:
\r
\r
\r
\r
\r
\r
void foo(){}
after:
# 6 "filename.ext"
void foo(){}

https://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html

this is dramatically decrease size of output file

shevek commented 4 years ago

Very good idea, and somewhat artfully chosen. #line directives were a pain in the [....] and I'll spend a bit more time on this.