Red Hat Bugzilla – Bug 154084
gcc -E -o silently stops output when line exceeds 4k
Last modified: 2007-11-30 17:11:03 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050323 Firefox/1.0.2 Fedora/1.0.2-1.3.1
Description of problem:
-E tells gcc to output the result of preprocessing, without compiling it.
When gcc -E -o generates a line longer than 4k, it stops output in the middle. No other lines are produced. The exit code is 0 (happy).
Truncation is bad.
Truncation without diagnostic is worse.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. gcc -E -o gcc-E-truncation.E gcc-E-truncation.c
2. echo $?
3. examine the last line of output.
(see attached file gcc-E-truncation.c)
Actual Results: Exit code was 0.
The output stopped at 4k into the long line
Expected Results: proper output produced
Created attachment 112800 [details]
source for gcc-E-truncation.c
the file contains comments describing how to preprocess the program. This step
fails with truncation.
Can't reproduce with current FC3 testing update.
gcc -E -o gcc-E-truncation.E gcc-E-truncation.c; gcc -E gcc-E-truncation.c | wc;
18 1368 12279
18 1368 12279 gcc-E-truncation.E
Appology: it turns out that a tool I was using to examine the output had this
bad behaviour. gcc itself seems to be fine.