xiaoyin0208 / lz4

Automatically exported from code.google.com/p/lz4
0 stars 0 forks source link

warning: ignoring return value of ‘fwrite’ #45

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. make clean
2. make

What is the expected output? What do you see instead?
lz4demo.c: In function ‘decode_file’:
lz4demo.c:294:9: warning: ignoring return value of ‘fwrite’, declared with 
attribute warn_unused_result
lz4demo.c: In function ‘compress_file’:
lz4demo.c:202:8: warning: ignoring return value of ‘fwrite’, declared with 
attribute warn_unused_result
lz4demo.c:223:9: warning: ignoring return value of ‘fwrite’, declared with 
attribute warn_unused_result

What version of the product are you using? On what operating system?
gcc-4.5.3, glibc-2.14.1-r3, linux

Please provide any additional information below.
return value of fwrite is not checked anywhere, at all.
which means compression or decompression will silently fail on a full disk
also output may be corrupted due to temporary disk error, e.g. comp/decomp 
output to a network file system

Original issue reported on code.google.com by dim...@gmail.com on 29 Nov 2012 at 12:28

GoogleCodeExporter commented 8 years ago
Good point. I'll look into it.

Original comment by yann.col...@gmail.com on 29 Nov 2012 at 1:06

GoogleCodeExporter commented 8 years ago
I'll look into it.

Original comment by yann.col...@gmail.com on 29 Nov 2012 at 7:48

GoogleCodeExporter commented 8 years ago
The following release candidate should correct the reported issue.

Original comment by yann.col...@gmail.com on 29 Nov 2012 at 8:37

Attachments:

GoogleCodeExporter commented 8 years ago
Corrected into r84.

Original comment by yann.col...@gmail.com on 30 Nov 2012 at 1:24