Subject: bug#54607: ncurses attrset colour pair ignored in favour of bkgd

From: Roman Riabenko <[email-masked]>
Date: Thu, 07 Apr 2022 15:50:03 +0300

Hello

Thank you for directing me to those options.

Setting _XOPEN_SOURCE to 500 or higher seems to restore the expected
functionality of attrset in ncurses for colour. _XOPEN_SOURCE is a
feature test macro, so it just determines that some functionality from
X/Open is used (X/OPEN 5 for _XOPEN_SOURCE 500, X/OPEN 6 for
_XOPEN_SOURCE 600, etc.). The program that is being compiled can have
its own tests for functionality that it needs. I can add "#define
_XOPEN_SOURCE 500" to the beginning of test.c from my previous email to
make it work as it should when built with guix. So, this is something,
the program could normally figure out itself without relying on curses
being implemented in a specific way.

There is a section on alternate configurations of ncurses in its manual
[1] noting that it may be necessary for some functionality of ncurses
to specify _XOPEN_SOURCE up to 600 for programs compiled against
ncurses when the latter was built with --enable-widec. Since this
option was chosen for ncurses in guix, it is fair enough that some
functionality may need _XOPEN_SOURCE 600, even if I am not sure how my
case is related to wide character support or what functionality from
X/Open is used.

[1]:
https://invisible-island.net/ncurses/man/ncurses.3x.html#h2-ALTERNATE-CONFIGURATIONS

I believe that the above is enough to close this issue.

Roman