[Bug preprocessor/67266] Use of "cpp -P ..." collapses multiple blank lines
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Aug 19 02:08:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67266
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |msebor at gcc dot gnu.org
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
The "long runs of blank lines are discarded" part refers to the constant 8
hardcoded in the maybe_print_line_1 function. The constant's effect can be
seen in the following test case. The first sequence of 7 newlines is retained
while the second one of 8 newlines is compressed.
$ cat -n a.txt && gcc -dU -E -xc a.txt | cat -n
1 line 1
2
3
4
5
6
7
8 line 8
9
10
11
12
13
14
15
16
17 line 17
1 # 1 "a.txt"
2 # 1 "<built-in>"
3 # 1 "<command-line>"
4 # 1 "/usr/include/stdc-predef.h" 1 3 4
5 #undef _STDC_PREDEF_H
6 #define __GCC_IEC_559 2
7 #define __GCC_IEC_559_COMPLEX 2
8 # 1 "<command-line>" 2
9 # 1 "a.txt"
10 line 1
11
12
13
14
15
16
17 line 8
18 # 17 "a.txt"
19 line 17
More information about the Gcc-bugs
mailing list