This change fixes a compile error seen in gcc 16.1.1 in Fedora 44:

scan.c: In function ‘clear_screen’:
scan.c:203:33: error: passing argument 3 of ‘tputs’ from incompatible pointer 
type [-Wincompatible-pointer-types]
  203 |                   tputs(clr, 1, (int (*)())putstdout);
      |                                 ^~~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 int (*)(void)
In file included from scan.c:21:
/usr/include/termcap.h:66:54: note: expected ‘int (*)(int)’ but argument is of 
type ‘int (*)(void)’
   66 | extern NCURSES_EXPORT(int) tputs (const char *, int, int (*)(int));
---
 mh/scan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mh/scan.c b/mh/scan.c
index 8858e128e..0a49ecd91 100644
--- a/mh/scan.c
+++ b/mh/scan.c
@@ -200,7 +200,7 @@ clear_screen (void)
              char *clr = tgetstr ("cl", &buffer);
              if (clr)
                {
-                 tputs(clr, 1, (int (*)())putstdout);
+                 tputs(clr, 1, (int (*)(int))putstdout);
                  return;
                }
            }
-- 
2.54.0


Reply via email to