Re: disabling warn_unused_result attribute with FORTIFY_SOURCE?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.

On Thu, 15 Mar 2007 05:11:55 +0100, Miloslav Trmac wrote:

> > Fix the code.  All those warnings are problems.
> How about fwrite ()?  What's wrong with just using ferror () before
> closing the file?

All the write functions return the amount of bytes actually written,
which may be different from the amount of data you gave it to write.

Many programmers ignore this (and in 99.9% of all cases get away with it
because write actually writes the whole data), but it only _has_ to write
a single byte before returning without error (given blocking IO).

-- 
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux