Subject: bin/3837: xntpd/parse.c won't compile on NetBSD/alpha
To: None <gnats-bugs@gnats.netbsd.org>
From: None <enami@but-b.or.jp>
List: netbsd-bugs
Date: 07/08/1997 22:30:13
>Number:         3837
>Category:       bin
>Synopsis:       xntpd/parse.c won't compile on NetBSD/alpha
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul  8 06:35:00 1997
>Last-Modified:
>Originator:     enami tsugutomo
>Organization:
>Release:        NetBSD-current 1997 Jul 05
>Environment:
System: NetBSD red-glasses.enami.ba2.so-net.or.jp 1.2G NetBSD 1.2G (RED_GLASSES) #81: Sat Jun 28 23:08:05 JST 1997 enami@red-glasses.enami.ba2.so-net.or.jp:/usr/src/sys/arch/alpha/compile/RED_GLASSES alpha


>Description:
	xntpd/parse.c won't compile on NetBSD/alpha.

>How-To-Repeat:
	Here is a make log on NetBSD/alpha:

cc -O -I/usr/src/usr.sbin/xntp/xntpd/../include -DHAVE_CONFIG_H  -I/usr/src/usr.sbin/xntp/xntpd/../include -DHAVE_CONFIG_H -Werror  -c /usr/src/usr.sbin/xntp/xntpd/parse.c
cc1: warnings being treated as errors
/usr/src/usr.sbin/xntp/xntpd/parse.c: In function `parse_ioread':
/usr/src/usr.sbin/xntp/xntpd/parse.c:387: warning: cast from pointer to integer of different size
*** Error code 1

Stop.
>Fix:
	That is since cast pointer to integer which is small that
	pointer.

	Here is my fix, cast pointer to long instead of int and change
	format string to %lx:

Index: parse.c
===================================================================
RCS file: /a/cvsroot/NetBSD/src/usr.sbin/xntp/xntpd/parse.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 parse.c
--- parse.c	1997/06/24 18:43:56	1.1.1.1
+++ parse.c	1997/07/08 13:26:44
@@ -384,7 +384,7 @@
       break;
     }
 
-  parseprintf(DD_PARSE, ("parse_ioread(0x%x, char=0x%x, ..., ...)\n", (unsigned int)parseio, ch & 0xFF));
+  parseprintf(DD_PARSE, ("parse_ioread(0x%lx, char=0x%x, ..., ...)\n", (unsigned long)parseio, ch & 0xFF));
 
   if (parseio->parse_flags & PARSE_FIXED_FMT)
     {
>Audit-Trail:
>Unformatted: