NetBSD Problem Report #10553
Received: (qmail 9566 invoked from network); 10 Jul 2000 00:24:27 -0000
Message-Id: <200007100024.RAA19685@nbwww.isc.org>
Date: Sun, 9 Jul 2000 17:24:26 -0700 (PDT)
From: motoyuki@bsdclub.org
Reply-To: motoyuki@bsdclub.org
To: gnats-bugs@gnats.netbsd.org
Subject: usr.bin/newsyslog compile fails because of the "int format, long int arg" warnings
X-Send-Pr-Version: www-1.0
>Number: 10553
>Category: bin
>Synopsis: usr.bin/newsyslog compile fails because of the "int format, long int arg" warnings
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: assar
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Jul 10 00:25:00 +0000 2000
>Closed-Date: Mon Jul 10 14:08:25 +0000 2000
>Last-Modified: Mon Jul 10 14:08:25 +0000 2000
>Originator: Motoyuki Konno
>Release: NetBSD-current
>Organization:
>Environment:
NetBSD sparc.mk.bsdclub.org 1.5B NetBSD 1.5B (SPARC) #0:
Thu Jul 6 21:47:47 JST 2000
>Description:
Compiling usr.bin/newsyslog/newsyslog.c fails because of the
"warning: int format, long int arg" warnings at line 349.
>How-To-Repeat:
cd usr.bin/newsyslog; make
>Fix:
--- newsyslog.c.old Mon Jul 10 07:05:45 2000
+++ newsyslog.c Mon Jul 10 07:25:28 2000
@@ -346,7 +346,7 @@
if (verbose) {
if (ent->maxsize != (size_t)-1)
- PRINFO(("size (Kb): %d [%d] ", size, ent->maxsize));
+ PRINFO(("size (Kb): %ld [%ld] ", size, ent->maxsize));
if (ent->maxage > 0)
PRINFO((" age (hr): %d [%d] ", modtime, ent->maxage));
}
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback
State-Changed-By: assar
State-Changed-When: Sun Jul 9 19:22:30 PDT 2000
State-Changed-Why:
I sent a fix to the submitter
Responsible-Changed-From-To: bin-bug-people->assar
Responsible-Changed-By: assar
Responsible-Changed-When: Sun Jul 9 19:22:30 PDT 2000
Responsible-Changed-Why:
I took care of it
From: assar@netbsd.org
To: motoyuki@bsdclub.org
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/10553: usr.bin/newsyslog compile fails because of the "int format, long int arg" warnings
Date: 10 Jul 2000 04:22:32 +0200
motoyuki@bsdclub.org writes:
> >Description:
> Compiling usr.bin/newsyslog/newsyslog.c fails because of the
> "warning: int format, long int arg" warnings at line 349.
> >How-To-Repeat:
> cd usr.bin/newsyslog; make
>
> >Fix:
> --- newsyslog.c.old Mon Jul 10 07:05:45 2000
> +++ newsyslog.c Mon Jul 10 07:25:28 2000
> @@ -346,7 +346,7 @@
>
> if (verbose) {
> if (ent->maxsize != (size_t)-1)
> - PRINFO(("size (Kb): %d [%d] ", size, ent->maxsize));
> + PRINFO(("size (Kb): %ld [%ld] ", size, ent->maxsize));
> if (ent->maxage > 0)
> PRINFO((" age (hr): %d [%d] ", modtime, ent->maxage));
> }
I don't think this fix is correct since it's not defined what type
`size_t' will be and if it's `int' != `long' then this also fails.
Please try the appended patch instead:
/assar
Index: newsyslog.c
===================================================================
RCS file: /cvsroot/basesrc/usr.bin/newsyslog/newsyslog.c,v
retrieving revision 1.26
diff -u -w -u -w -r1.26 newsyslog.c
--- newsyslog.c 2000/07/09 12:14:01 1.26
+++ newsyslog.c 2000/07/10 02:21:15
@@ -346,7 +346,9 @@
if (verbose) {
if (ent->maxsize != (size_t)-1)
- PRINFO(("size (Kb): %d [%d] ", size, ent->maxsize));
+ PRINFO(("size (Kb): %lu [%lu] ",
+ (u_long)size,
+ (u_long)ent->maxsize));
if (ent->maxage > 0)
PRINFO((" age (hr): %d [%d] ", modtime, ent->maxage));
}
From: Motoyuki Konno <motoyuki@bsdclub.org>
To: assar@netbsd.org
Cc: motoyuki@bsdclub.org, gnats-bugs@gnats.netbsd.org
Subject: Re: bin/10553: usr.bin/newsyslog compile fails because of the "int format, long int arg" warnings
Date: Mon, 10 Jul 2000 21:21:56 +0900
Hi,
assar@netbsd.orgwrote:
> I don't think this fix is correct since it's not defined what type
> `size_t' will be and if it's `int' != `long' then this also fails.
> Please try the appended patch instead:
This patch works well. Thanks!
> Index: newsyslog.c
> ===================================================================
> RCS file: /cvsroot/basesrc/usr.bin/newsyslog/newsyslog.c,v
> retrieving revision 1.26
> diff -u -w -u -w -r1.26 newsyslog.c
> --- newsyslog.c 2000/07/09 12:14:01 1.26
> +++ newsyslog.c 2000/07/10 02:21:15
> @@ -346,7 +346,9 @@
>
> if (verbose) {
> if (ent->maxsize != (size_t)-1)
> - PRINFO(("size (Kb): %d [%d] ", size, ent->maxsize));
> + PRINFO(("size (Kb): %lu [%lu] ",
> + (u_long)size,
> + (u_long)ent->maxsize));
> if (ent->maxage > 0)
> PRINFO((" age (hr): %d [%d] ", modtime, ent->maxage));
> }
>
>
State-Changed-From-To: feedback->closed
State-Changed-By: ad
State-Changed-When: Mon Jul 10 06:57:28 PDT 2000
State-Changed-Why:
This is fixed. Thanks to all involved.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.