Subject: misc/8664: type mismatch "putchr()" in distrib/utils/more
To: None <gnats-bugs@gnats.netbsd.org>
From: None <h-masuda@ics.es.osaka-u.ac.jp>
List: netbsd-bugs
Date: 10/21/1999 19:15:49
>Number:         8664
>Category:       misc
>Synopsis:       type mismatch "putchr()" in distrib/utils/more
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people (Misc Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 21 19:15:00 1999
>Last-Modified:
>Originator:     
>Organization:
	Department of Informatics and Mathematical Science,
	Graduate School of Engineering Science, OSAKA UNIVERSITY, JAPAN
>Release:        NetBSD-current source 1999/10/20 by sup from sup.jp.netbsd.org
>Environment:
	
System: NetBSD meiko.ics.es.osaka-u.ac.jp 1.4L NetBSD 1.4L (MEIKO.v6) #4: Tue Oct 19 18:03:23 JST 1999 h-masuda@meiko.ics.es.osaka-u.ac.jp:/usr/src/sys/arch/alpha/compile/MEIKO.v6 alpha

>Description:
    The 3rd argument of tputs() requires "int (*outc)(int)", but
    in screen.c,
	tputs(sc_init, sc_height, putchr);
    and putchr() function is decleared as "void putchr(int)" in
    output.c and extern.h. This is conflict.

(from compiling log)
	(snip)
cc -O2  -Werror  -I/usr/src/distrib/utils/more  -c screen.c
cc1: warnings being treated as errors
screen.c: In function `init':
screen.c:464: warning: passing arg 3 of `tputs' from incompatible pointer type
screen.c: In function `deinit':
screen.c:473: warning: passing arg 3 of `tputs' from incompatible pointer type
screen.c: In function `home':
screen.c:482: warning: passing arg 3 of `tputs' from incompatible pointer type
screen.c: In function `add_line':
screen.c:492: warning: passing arg 3 of `tputs' from incompatible pointer type
screen.c: In function `lower_left':
screen.c:504: warning: passing arg 3 of `tputs' from incompatible pointer type
screen.c: In function `clear':
screen.c:522: warning: passing arg 3 of `tputs' from incompatible pointer type
screen.c: In function `clear_eol':
screen.c:532: warning: passing arg 3 of `tputs' from incompatible pointer type
screen.c: In function `so_enter':
screen.c:541: warning: passing arg 3 of `tputs' from incompatible pointer type
screen.c: In function `so_exit':
screen.c:550: warning: passing arg 3 of `tputs' from incompatible pointer type
screen.c: In function `ul_enter':
screen.c:560: warning: passing arg 3 of `tputs' from incompatible pointer type
screen.c: In function `ul_exit':
screen.c:569: warning: passing arg 3 of `tputs' from incompatible pointer type
screen.c: In function `bo_enter':
screen.c:578: warning: passing arg 3 of `tputs' from incompatible pointer type
screen.c: In function `bo_exit':
screen.c:587: warning: passing arg 3 of `tputs' from incompatible pointer type
screen.c: In function `backspace':
screen.c:600: warning: passing arg 3 of `tputs' from incompatible pointer type
screen.c:602: warning: passing arg 3 of `tputs' from incompatible pointer type
screen.c: In function `putbs':
screen.c:611: warning: passing arg 3 of `tputs' from incompatible pointer type
*** Error code 1
	
>How-To-Repeat:
	(cd distrib/utils/more; make)
>Fix:
	Change putchr() from void putchr(int) to int putchr(int) as
	following patch.

--- extern.h-ORG	Wed Feb  4 21:16:38 1998
+++ extern.h	Fri Oct 22 10:54:12 1999
@@ -93,7 +93,7 @@
 void put_line __P((void));
 void flush __P((void));
 void purge __P((void));
-void putchr __P((int));
+int putchr __P((int));
 void putstr __P((char *));
 void error __P((char *));
 void ierror __P((char *));
--- output.c-ORG	Wed Feb  4 21:16:42 1998
+++ output.c	Fri Oct 22 10:54:23 1999
@@ -163,7 +163,7 @@
 /*
  * Output a character.
  */
-void
+int
 putchr(c)
 	int c;
 {
>Audit-Trail:
>Unformatted: