Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

htop fails to compile with gcc-14.1 unless ncurses has been built with --enable-sigwinch #1474

Open
heitbaum opened this issue May 7, 2024 · 1 comment
Labels
bug 🐛 Something isn't working build system 🔧 Affects the build system rather then the user experience
Milestone

Comments

@heitbaum
Copy link

heitbaum commented May 7, 2024

The below line causes a failure to compile htop with gcc-14.1 when ncurses has not been built with --enable-sigwinch.

htop/ScreenManager.c

Lines 361 to 365 in 4b3dfa2

case KEY_RESIZE:
{
ScreenManager_resize(this);
continue;
}

../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
@fasterit
Copy link
Member

fasterit commented May 7, 2024

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.

@BenBE BenBE added bug 🐛 Something isn't working build system 🔧 Affects the build system rather then the user experience labels May 7, 2024
@BenBE BenBE added this to the 3.4.0 milestone May 7, 2024
fasterit pushed a commit to fasterit/htop that referenced this issue May 7, 2024
i.e. ncurses(w) compiled with the default --enable-sigwinch
Closes htop-dev#1474. Thank you very much Rudi Heitbaum.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working build system 🔧 Affects the build system rather then the user experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants