kconfig: nconf: get rid of (void) casts from wattrset() calls
authorMasahiro Yamada <masahiroy@kernel.org>
Sat, 10 Apr 2021 19:45:32 +0000 (04:45 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 14 Apr 2021 06:22:49 +0000 (15:22 +0900)
commit2ba50da9ec34196a895b4947dc6bb1dbf1ace670
tree2fa7b9d9e3735a7df46791a7cce6aada4cd604d0
parent7f5ff55bf8eb99e42c10388ccffdfbb0a0caac67
kconfig: nconf: get rid of (void) casts from wattrset() calls

This reverts commit 10175ba65fde ("nconfig: Silence unused return values
from wattrset").

With this patch applied, recent GCC versions can cleanly build nconf
without "value computed is not used" warnings.

The wattrset() used to be implemented as a macro, like this:

  #define wattrset(win,at) \
          (NCURSES_OK_ADDR(win) \
            ? ((win)->_attrs = NCURSES_CAST(attr_t, at), \
               OK) \
            : ERR)

The GCC bugzilla [1] reported a false-positive -Wunused-value warning
in a similar test case. It was fixed by GCC 4.4.1.

Let's revert that commit, and see if somebody will claim the issue.

[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39889

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kconfig/nconf.c
scripts/kconfig/nconf.gui.c