bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

termios.h not included if sys/ioctl.h provides struct winsize


From: Grisha Levit
Subject: termios.h not included if sys/ioctl.h provides struct winsize
Date: Mon, 12 Aug 2024 22:18:57 -0400

On e.g. Alpine Linux, the following are set by configure:

    bash_cv_struct_winsize_ioctl='yes'
    bash_cv_struct_winsize_termios='yes'
    bash_cv_struct_winsize_header='ioctl_h'
    ac_cv_func_tcgetwinsize='yes'

and so config.h ends up with:

    #define STRUCT_WINSIZE_IN_SYS_IOCTL 1
    /* #undef STRUCT_WINSIZE_IN_TERMIOS */
    #define HAVE_TCGETWINSIZE 1

This causes termios.h to not get included by lib/sh/winsize.c:

    #if defined (STRUCT_WINSIZE_IN_TERMIOS) && !defined 
(STRUCT_WINSIZE_IN_SYS_IOCTL)
    #  include <termios.h>
    #endif

and a build failure:

    winsize.c:95:20: error: call to undeclared function 'tcgetwinsize'; ISO C99 
and later do not support implicit function declarations 
[-Wimplicit-function-declaration]
       95 |   if (tty >= 0 && (tcgetwinsize (tty, &win) == 0) && win.ws_row > 0 
&& win.ws_col > 0)
          |                    ^



reply via email to

[Prev in Thread] Current Thread [Next in Thread]