[0/8] Fix warn unused result

Message ID 20230418121130.844302-1-fberat@redhat.com
Headers
Series Fix warn unused result |

Message

Frederic Berat April 18, 2023, 12:11 p.m. UTC
  Hello,

Enabling _FORTIFY_SOURCE on Glibc itself implies that some function get the
__wur macro enabed.
This leads to build failures when -Werror is set.

I went for multiple patches for these fixes, a big one that cover the tests,
and then separate one for the other ones, assuming they may need to get a
closer look at.

While most of the changes look trivial, decision I made on how to fix them may
be open to debate, e.g. the additional checks may lead to failures while they
weren't earlier, some other have no impact while it may be useful to have one.

Feedback is therefore highly appreciated.

Fred.

---
Frédéric Bérat (8):
  tests: fix warn unused result
  catgets/gencat.c: fix warn unused result
  inet/rcmd.c: fix warn unused result
  locale/programs/locarchive.c: fix warn unused result
  malloc/{memusage.c,memusagestat.c}: fix warn unused result
  nptl_db/thread_dbP.h: fix warn unused result
  sunrpc/netname.c: fix warn unused result
  sysdeps/pthread/eintr.c: fix warn unused result

 argp/argp-test.c               | 14 ++++++++++---
 assert/test-assert-perr.c      | 13 ++++++------
 assert/test-assert.c           | 13 ++++++------
 catgets/gencat.c               | 34 ++++++++++++++++++++----------
 crypt/cert.c                   |  6 +++++-
 dirent/tst-fdopendir.c         | 13 ++++++++++--
 elf/tst-stackguard1.c          |  2 +-
 inet/rcmd.c                    |  7 +++++--
 io/tst-copy_file_range.c       |  2 +-
 io/tst-faccessat.c             |  6 +++++-
 io/tst-fchmodat.c              |  6 +++++-
 io/tst-fchownat.c              |  6 +++++-
 io/tst-fstatat.c               |  6 +++++-
 io/tst-futimesat.c             |  6 +++++-
 io/tst-linkat.c                |  6 +++++-
 io/tst-openat.c                |  6 +++++-
 io/tst-renameat.c              |  6 +++++-
 io/tst-symlinkat.c             |  6 +++++-
 io/tst-unlinkat.c              |  6 +++++-
 libio/bug-fseek.c              | 15 +++++++++++---
 libio/bug-mmap-fflush.c        | 12 +++++++++--
 libio/bug-ungetc.c             |  7 ++++++-
 libio/bug-ungetc3.c            |  7 ++++++-
 libio/bug-ungetc4.c            |  7 ++++++-
 libio/bug-wfflush.c            |  6 +++++-
 libio/bug-wsetpos.c            |  7 ++++++-
 locale/programs/locarchive.c   | 18 +++++++++-------
 malloc/memusage.c              | 38 +++++++++++++++++++++++-----------
 malloc/memusagestat.c          | 13 ++++++++----
 misc/tst-efgcvt-template.c     |  4 ++--
 misc/tst-error1.c              |  2 +-
 nptl/tst-cancel7.c             |  2 +-
 nptl/tst-cleanup4.c            |  6 +++++-
 nptl/tst-stackguard1.c         |  8 +++++--
 nptl/tst-tls3mod.c             |  4 ++--
 nptl_db/thread_dbP.h           |  2 +-
 nss/tst-nss-db-endpwent.c      |  6 +++++-
 nss/tst-reload2.c              |  6 +++++-
 posix/tst-chmod.c              |  9 ++++++--
 posix/tst-execl2.c             |  4 ++--
 posix/tst-execle2.c            |  4 ++--
 posix/tst-execlp2.c            |  7 +++----
 posix/tst-execv2.c             |  3 +--
 posix/tst-execve2.c            |  3 +--
 posix/tst-execvp2.c            |  6 ++----
 posix/tst-getopt-cancel.c      |  2 +-
 posix/tst-nice.c               |  3 +--
 posix/wordexp-test.c           | 12 +++++++++--
 rt/tst-cpuclock2.c             |  2 +-
 rt/tst-cputimer1.c             |  2 +-
 rt/tst-cputimer2.c             |  2 +-
 rt/tst-cputimer3.c             |  2 +-
 stdio-common/bug12.c           | 15 +++++++++-----
 stdio-common/bug19.c           |  9 ++++++--
 stdio-common/bug3.c            |  6 +++++-
 stdio-common/bug4.c            |  6 +++++-
 stdio-common/bug5.c            |  6 +++++-
 stdio-common/bug6.c            |  8 +++----
 stdio-common/test-fwrite.c     |  8 +++++--
 stdio-common/test_rdwr.c       |  3 ++-
 stdio-common/tst-cookie.c      |  4 +++-
 stdio-common/tst-fmemopen3.c   |  6 +++++-
 stdio-common/tst-fseek.c       |  3 +--
 stdio-common/tst-perror.c      |  6 +++++-
 stdio-common/tstscanf.c        | 14 +++++++++++--
 stdlib/test-canon.c            | 25 ++++++++++++++++++----
 sunrpc/netname.c               |  3 ++-
 support/test-container.c       | 18 +++++++++-------
 sysdeps/pthread/eintr.c        |  4 ++--
 sysdeps/pthread/tst-cancel11.c |  6 +++++-
 sysdeps/pthread/tst-cancel16.c |  6 +++++-
 sysdeps/pthread/tst-cancel20.c |  2 --
 sysdeps/pthread/tst-cancel21.c |  2 --
 sysdeps/pthread/tst-cancel4.c  |  6 ++++--
 sysdeps/pthread/tst-cancel6.c  |  3 ++-
 sysdeps/pthread/tst-cond18.c   |  2 +-
 sysdeps/pthread/tst-fini1mod.c |  6 +++++-
 sysdeps/pthread/tst-flock1.c   |  6 +++++-
 sysdeps/pthread/tst-flock2.c   |  6 +++++-
 sysdeps/pthread/tst-key1.c     | 10 ++++-----
 sysdeps/pthread/tst-signal1.c  |  6 +++++-
 sysdeps/pthread/tst-signal2.c  |  6 +++++-
 sysdeps/pthread/tst-timer.c    |  2 +-
 time/tst-cpuclock1.c           |  2 +-
 84 files changed, 434 insertions(+), 176 deletions(-)