If you look at the other changes in this patch the other changes are for
freopen(), getcwd() and daemon().  All of those were 'easy' to fix the
ignored return values.  I believe I also submitted a patch for writev()
which also has this problem as well( again it had code already in place to
smartly handle the error ).

I imagine we wouldn't be having this discussion if the code had an easy
methodology to handle the write failure and to safely handle it.  I erred
on the side of make it work without modifying code paths since I didn't
understand that section of code, nor did I have a good way to test that it
works properly.

Perhaps it would be good for us to focus our attention on actually fixing
the issue( maybe someone knows that code ) and can suggest a good way to
handle the failed write, instead of arguing about the compiler and glibc
actions which we (obviously) disagree with.

donald



On Mon, Oct 12, 2015 at 12:49 PM, Greg Troxel <[email protected]> wrote:

>
> Donald Sharp <[email protected]> writes:
>
> > extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur;
> >
> > ./x86_64-linux-gnu/sys/cdefs.h:#define __wur
> __attribute_warn_unused_result__
>
> That explains it.  It seems surprising to define write that way.  I
> wonder how much other code is hitting this; I would  expect it to cause
> a lot of fallout.
>
> FWIW, here's what POSIX says about how write should be defined:
>
> http://pubs.opengroup.org/onlinepubs/009695399/functions/write.html
>
> which matches except for the gcc declaration.
>
> I wonder how this affects building with clang on Debian.
>
_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to