Opened 11 years ago
Closed 11 years ago
#290 closed defect (fixed)
Program termination does not flush output buffers
Reported by: | Yuri Dario | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | libc-0.6.6 |
Component: | gcc | Version: | 0.6.5 |
Severity: | normal | Keywords: | |
Cc: |
Description
Output buffers are not flushed if file handle is not closed before program end. Sample testcase:
#include <stdio.h> #include <string.h> void main(void) { char* buf = "this is my test buffer"; FILE *fo = fopen( "test", "w"); fwrite( buf, 1, strlen( buf), fo); }
leaves a 0-byte file on disk. Adding flush or fclose restores proper behaviour.
Change History (4)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
The testcase built with gcc 4.4.6 works as designed.
This is not a libc bug, closing.
comment:3 by , 11 years ago
Component: | libc → gcc |
---|---|
Resolution: | invalid |
Status: | closed → reopened |
comment:4 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Note:
See TracTickets
for help on using tickets.
This problem turned out building a c preprocessor (for AOO builds)
http://code.google.com/p/ucpp/
using gcc 4.7.3. But I just discovered an old build that was working, and built using the same sources and patches. The only difference if that old build was done with gcc 4.4.6.