This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/67266] Use of "cpp -P ..." collapses multiple blank lines
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 19 Aug 2015 02:08:15 +0000
- Subject: [Bug preprocessor/67266] Use of "cpp -P ..." collapses multiple blank lines
- Auto-submitted: auto-generated
- References: <bug-67266-4 at http dot gcc dot gnu dot org/bugzilla/>
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