htop
htop copied to clipboard
htop fails to compile with gcc-14.1 unless ncurses has been built with --enable-sigwinch
The below line causes a failure to compile htop with gcc-14.1 when ncurses has not been built with --enable-sigwinch. https://github.com/htop-dev/htop/blob/4b3dfa246e9fa0fe3ce7d97e7a37239251ada42b/ScreenManager.c#L361-L365
../ScreenManager.c: In function 'ScreenManager_run':
../ScreenManager.c:361:12: error: 'KEY_RESIZE' undeclared (first use in this function); did you mean 'KEY_RESUME'?
361 | case KEY_RESIZE:
| ^~~~~~~~~~
| KEY_RESUME
../ScreenManager.c:361:12: note: each undeclared identifier is reported only once for each function it appears in
Ref:
/*
* KEY_RESIZE is an extended feature that relies upon the SIGWINCH handler
* in ncurses.
*/
#if 1
#ifndef NCURSES_SIGWINCH
#define NCURSES_SIGWINCH 1
#endif
#else
#undef NCURSES_SIGWINCH
#define NCURSES_SIGWINCH 0
#endif
...
#if NCURSES_SIGWINCH
#define KEY_RESIZE 0632 /* Terminal resize event */
#endif
hm, we could #ifdef that. And we could write our own signal handler for sigwinch in case ncurses has been compiled without its own. Or we gracefully complain and exit at the configure stage.
@fasterit Does this issue still happen with the current main? I noticed #1475 has been closed because of ProvideCurses.h dependency on config.h or something like that, but as I made the commit a2d90f4d19f11f5e96ef9faf5f50d51a5c260c73 that fixed that config.h thing, maybe the configure check on KEY_RESIZE can be revisited again and #1475 rebased onto the current main.
What's the status for this? Any PR addressing this?
I think this is sufficiently covered with the configure check from #1475. Closing. Please feel free to re-open if you think differently.