From owner-freebsd-bugs@FreeBSD.ORG Sun Sep 12 20:10:58 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4C86F16A58B for ; Sun, 12 Sep 2004 20:10:58 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3E74143D2F for ; Sun, 12 Sep 2004 20:10:58 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i8CKAwJv028215 for ; Sun, 12 Sep 2004 20:10:58 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i8CKAwm1028214; Sun, 12 Sep 2004 20:10:58 GMT (envelope-from gnats) Date: Sun, 12 Sep 2004 20:10:58 GMT Message-Id: <200409122010.i8CKAwm1028214@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Giorgos Keramidas Subject: Re: bin/71618: [PATCH] cleanup of the usr.sbin/timed code X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Giorgos Keramidas List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2004 20:10:58 -0000 The following reply was made to PR bin/71618; it has been noted by GNATS. From: Giorgos Keramidas To: Dan Lukes Cc: bug-followup@freebsd.org Subject: Re: bin/71618: [PATCH] cleanup of the usr.sbin/timed code Date: Sun, 12 Sep 2004 21:35:35 +0300 On 2004-09-12 04:37, Dan Lukes wrote: > usr.sbin/timed/timed/readmsg.c:501: warning: long int format, int32_t arg (arg 6) > usr.sbin/timed/timed/readmsg.c:501: warning: long int format, int32_t arg (arg 7) > - fprintf(fd, "%s %d %-6u (%ld,%ld) %-15s %s\n", > + fprintf(fd, "%s %d %-6u (%d,%d) %-15s %s\n", There's no guarantee that an int32_t value will be defined with an `int'. This might result in unexpected truncation of the printed value. A better fix, IMHO, would be to change the format to %jd and then cast the value to (intmax_t) which should avoid truncation of the value (you'll also have to include for intmax_t to be visible). There are many other warnings in timed that are exposed if you try to build it with an increased WARNS level. Since you seem to like doing this sort of work, can you try the following (and see if you can come up with fixes for the warnings this shows)? # cd /usr/src/usr.sbin/timed/ # make NO_WERROR=1 WARNS?=3 Thank you for your work so far :-)