While I know it can be a frustration, it is a trade-off Ubuntu made.  On
the average, having wur on fread is a benefit.  As an example of our
evaluations, we disabled wur on fwrite because that was not actually
meaningful (i.e. failures could happen at fclose, and that was not being
checked).  For fread, it tends to be safer to actually check the size of
how much was read, and handle it in some way -- it is a way to catch
bugs is most cases.

If you want to keep the other compile-time and run-time protections of
_FORTIFY_SOURCE, but do not want these warnings, the only way to solve
it currently is to fix the fread calls.  To disable all the checking,
add -U_FORTIFY_SOURCE to your CPPFLAGS.  We carry patches to Ubuntu
software that uses -Werror so the freads are checked, and upstreams take
those patches.

I'm open to taking patches for other ways of dealing with the issue.
Perhaps glibc could be patched to disable wur on the fortify targets via
some other define?

** Changed in: glibc (Ubuntu)
       Status: New => Won't Fix

-- 
fread declared with __wur (warn_unused_result)
https://bugs.launchpad.net/bugs/367359
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to