From 5c744e37b6375f3f6842cdf3758a180a649bafea Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 2 Jul 2026 00:53:37 +0300 Subject: ycurses: get it building on modern GCC, verify in Docker (task 9s0) ycurses shares no source files with ychat/yhttpd (it's an ncurses UI toolkit, not part of the httpd/socket engine), so none of the sock/reqp/ html/logd/tool fixes apply here - only the same class of toolchain-gate bugs did: - Top-level configure's g++ 3.x version gate now accepts any GNU g++ (same fix as yhttpd/configure). - scripts/config.pl silently BEGIN-failed on modern Perl (`use scripts::modules::file` needs "." on @INC, dropped by Perl 5.26+); the "yes" default answer was never actually read. Fixed with `perl -I.` (also applied to yhttpd/configure, which had the same latent bug). - src/configure's library search paths predate 64-bit multilib distros (no /usr/lib64), so installed libpanel/libmenu/libncurses were reported "NOT OK" on Rocky Linux 9 (also backported to yhttpd/src/configure). - attributes.h declared `set set_attr` (std::set, via `using namespace std`) and separately two member functions literally named `set` - GCC 11 treats that as ill-formed ("changes meaning of 'set'"), not just a warning. Renamed both overloads to set_attr_flag; no external caller used the bare set(...)/set(int) names. Verified in a Rocky Linux 9 container: builds clean, links, and runs - initializes curses, draws the demo screen using color/attributes (exercising the fix above), exits cleanly. Added Dockerfile (build verification only - it's an interactive demo, not a service) and BUILD.md documenting the fixes and one pre-existing, deliberately unfixed bug (unset() never actually clears an attribute). Co-Authored-By: Claude Sonnet 5 --- ycurses/src/configure | 3 +++ ycurses/src/curses/attributes.cpp | 4 ++-- ycurses/src/curses/attributes.h | 35 ++++++++++++++++++++--------------- 3 files changed, 25 insertions(+), 17 deletions(-) (limited to 'ycurses/src') diff --git a/ycurses/src/configure b/ycurses/src/configure index cb7c9ff..cffbbda 100755 --- a/ycurses/src/configure +++ b/ycurses/src/configure @@ -51,8 +51,11 @@ perl -e ' $ENV{HOME}."/lib", $ENV{HOME}."/usr/lib", "/lib", + "/lib64", "/usr/lib", + "/usr/lib64", "/usr/local/lib", + "/usr/local/lib64", "/usr/pkg/lib", "/opt/lib", "/opt/local/lib" diff --git a/ycurses/src/curses/attributes.cpp b/ycurses/src/curses/attributes.cpp index b859da0..02f7e27 100644 --- a/ycurses/src/curses/attributes.cpp +++ b/ycurses/src/curses/attributes.cpp @@ -11,7 +11,7 @@ attributes::attributes() attributes::attributes(int i_attr) { init(); - set(true, i_attr); + set_attr_flag(true, i_attr); } attributes::attributes(color& r_color) @@ -63,7 +63,7 @@ attributes::get(int i_attr) } void -attributes::set(bool b, int i_attr) +attributes::set_attr_flag(bool b, int i_attr) { if ((set_attr.find(i_attr) != set_attr.end() ) == b) return; diff --git a/ycurses/src/curses/attributes.h b/ycurses/src/curses/attributes.h index 2bc58d6..93a5e25 100644 --- a/ycurses/src/curses/attributes.h +++ b/ycurses/src/curses/attributes.h @@ -22,10 +22,15 @@ const int CharText = A_CHARTEXT; class attributes { private: - void init(); + void init(); set set_attr; bool get(int i_attr); - void set(bool b, int i_attr); + // Named set_attr_flag (not "set") because a member named exactly "set" + // here would collide with std::set - "using namespace std" makes both + // visible and GCC treats declaring the member as ill-formed ("changes + // meaning of 'set'"). Same class of fix as the function->mod_func_t + // rename in ychat/yhttpd's glob.h. + void set_attr_flag(bool b, int i_attr); color* p_color; friend class window; @@ -37,22 +42,22 @@ public: attributes(int i_attr); attributes(color& r_color); - void set(int i_attr) { set(true, i_attr); } - void unset(int i_attr ) { set(false, i_attr); } + void set_attr_flag(int i_attr) { set_attr_flag(true, i_attr); } + void unset(int i_attr ) { set_attr_flag(false, i_attr); } void unset_all(); void set_color(color& r_color); - void set_normal(bool b) { set(b, Normal); } - void set_standout(bool b) { set(b, Standout); } - void set_underline(bool b) { set(b, Underline); } - void set_reverse(bool b) { set(b, Reverse); } - void set_blink(bool b) { set(b, Blink); } - void set_dim(bool b) { set(b, Dim); } - void set_bold(bool b) { set(b, Bold); } - void set_protect(bool b) { set(b, Protect); } - void set_invisible(bool b) { set(b, Invis); } - void set_altcharset(bool b) { set(b, AltCharSet); } - void set_chartext(bool b) { set(b, CharText); } + void set_normal(bool b) { set_attr_flag(b, Normal); } + void set_standout(bool b) { set_attr_flag(b, Standout); } + void set_underline(bool b) { set_attr_flag(b, Underline); } + void set_reverse(bool b) { set_attr_flag(b, Reverse); } + void set_blink(bool b) { set_attr_flag(b, Blink); } + void set_dim(bool b) { set_attr_flag(b, Dim); } + void set_bold(bool b) { set_attr_flag(b, Bold); } + void set_protect(bool b) { set_attr_flag(b, Protect); } + void set_invisible(bool b) { set_attr_flag(b, Invis); } + void set_altcharset(bool b) { set_attr_flag(b, AltCharSet); } + void set_chartext(bool b) { set_attr_flag(b, CharText); } bool get_normal() { return get(Normal); } bool get_standout() { return get(Standout); } -- cgit v1.2.3