[PATCH] Correct signature for param to tputs()

Nikolas Nyby <[email protected]> Wed, 1 Jul 2026 10:52:21 -0400
Newsgroups gmane.comp.gnu.mailutils.bugs
Message-ID <[email protected]>
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