Subject: lib/3832: libutil/passwd.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/06/1997 21:05:53
>Number: 3832
>Category: lib
>Synopsis: libutil/passwd.c won't compile on NetBSD/alpha
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: lib-bug-people (Library Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Jul 6 05:20:01 1997
>Last-Modified:
>Originator: enami tsugutomo
>Organization:
>Release: NetBSD-current 1997 Jul 04
>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:
libutil/passwd.c won't compile on NetBSD/alpha
>How-To-Repeat:
Here is make log:
cc -O -DLIBC_SCCS -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -c /usr/src/lib/libutil/passwd.c
cc1: warnings being treated as errors
/usr/src/lib/libutil/passwd.c: In function `pw_copy':
/usr/src/lib/libutil/passwd.c:280: warning: long int format, different type arg (arg 8)
/usr/src/lib/libutil/passwd.c:280: warning: long int format, different type arg (arg 9)
/usr/src/lib/libutil/passwd.c:289: warning: long int format, different type arg (arg 8)
/usr/src/lib/libutil/passwd.c:289: warning: long int format, different type arg (arg 9)
*** Error code 1
Stop.
>Fix:
Here is my fix which cast int (time_t) to long:
Index: passwd.c
===================================================================
RCS file: /a/cvsroot/NetBSD/src/lib/libutil/passwd.c,v
retrieving revision 1.1.1.8
diff -u -r1.1.1.8 passwd.c
--- passwd.c 1997/06/30 18:11:03 1.1.1.8
+++ passwd.c 1997/07/06 12:01:40
@@ -276,8 +276,8 @@
}
(void)fprintf(to, "%s:%s:%d:%d:%s:%ld:%ld:%s:%s:%s\n",
pw->pw_name, pw->pw_passwd, pw->pw_uid, pw->pw_gid,
- pw->pw_class, pw->pw_change, pw->pw_expire, pw->pw_gecos,
- pw->pw_dir, pw->pw_shell);
+ pw->pw_class, (long)pw->pw_change, (long)pw->pw_expire,
+ pw->pw_gecos, pw->pw_dir, pw->pw_shell);
done = 1;
if (ferror(to))
goto err;
@@ -285,8 +285,8 @@
if (!done)
(void)fprintf(to, "%s:%s:%d:%d:%s:%ld:%ld:%s:%s:%s\n",
pw->pw_name, pw->pw_passwd, pw->pw_uid, pw->pw_gid,
- pw->pw_class, pw->pw_change, pw->pw_expire, pw->pw_gecos,
- pw->pw_dir, pw->pw_shell);
+ pw->pw_class, (long)pw->pw_change, (long)pw->pw_expire,
+ pw->pw_gecos, pw->pw_dir, pw->pw_shell);
if (ferror(to))
err: pw_error(NULL, 1, 1);
>Audit-Trail:
>Unformatted: