fwrite: silence __wur without using inline
authorEric Blake <eblake@redhat.com>
Thu, 3 Jan 2013 16:51:44 +0000 (09:51 -0700)
committerEric Blake <eblake@redhat.com>
Thu, 3 Jan 2013 17:05:29 +0000 (10:05 -0700)
commit61c7b1e32e11e9e40b4d59ab888a807620befcd3
tree647fdb8082a1df74fe2c94f44a613c35d8cd71e3
parent4f439be5eb433f530123e45c5d87d5af91f952ac
fwrite: silence __wur without using inline

The libvirt folks reported[1] a link error of multiple rpl_fwrite
definitions that hits only when optimization and FORTIFY_SOURCE
are both enabled, due to improper use of inline.  But since that
particular use of rpl_fwrite exists only to work around a spurious
gcc warning on some versions of glibc, we can use gcc extensions
to acheive the same effect without using inline.  This approach
copies from ignore-value.h.

[1] https://lists.gnu.org/archive/html/bug-gnulib/2013-01/msg00014.html

* lib/stdio.in.h (fwrite): Limit warn_unused_result workaround to
just gcc, and in a way that avoids inline issues.
* modules/stdio (Depends-on): Drop extern-inline.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
lib/stdio.in.h
modules/stdio