From dan@obluda.cz  Tue Sep  3 14:37:19 2002
Return-Path: <dan@obluda.cz>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 307C437B400
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  3 Sep 2002 14:37:19 -0700 (PDT)
Received: from xkulesh.vol.cz (xkulesh.vol.cz [195.250.154.106])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 0A26843E6A
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  3 Sep 2002 14:37:14 -0700 (PDT)
	(envelope-from dan@obluda.cz)
Received: from xkulesh.vol.cz (localhost [127.0.0.1])
	by xkulesh.vol.cz (8.12.5/8.12.5) with ESMTP id g83Lb8Jf000269;
	Tue, 3 Sep 2002 23:37:09 +0200 (CEST)
	(envelope-from dan@obluda.cz)
Received: (from dan@localhost)
	by xkulesh.vol.cz (8.12.6/8.12.6/Submit) id g83LDWGQ011140;
	Tue, 3 Sep 2002 23:13:32 +0200 (CEST)
Message-Id: <200209032113.g83LDWGQ011140@xkulesh.vol.cz>
Date: Tue, 3 Sep 2002 23:13:32 +0200 (CEST)
From: Dan Lukes <dan@obluda.cz>
Reply-To: Dan Lukes <dan@obluda.cz>
To: FreeBSD-gnats-submit@freebsd.org
Cc: dan@obluda.cz
Subject: clean libatm code from warnings
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         42385
>Category:       bin
>Synopsis:       clean libatm code from warnings
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    harti
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 03 14:40:03 PDT 2002
>Closed-Date:    Fri Jul 25 00:57:32 PDT 2003
>Last-Modified:  Fri Jul 25 00:57:32 PDT 2003
>Originator:     Dan Lukes
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
Obludarium
>Environment:
src/lib/libatm/atm_addr.c,v 1.8 2002/06/24 22:29:01

>Description:
lib/libatm/atm_addr.c:
 308: warning: long unsigned int format, __uint32_t arg (arg 3)
               long unsigned int format, __uint32_t arg (arg 4)
     #>> ntohl (despite of 'l' in it's name) 
     #>>   return uint32_t ( = __uint32_t = unsigned int )
     #>>   so 'l' modifier should not be used


>How-To-Repeat:
	N/A
>Fix:

--- lib/libatm/atm_addr.c.ORIG	Tue Jun 25 00:29:01 2002
+++ lib/libatm/atm_addr.c	Tue Sep  3 23:11:38 2002
@@ -28,7 +28,7 @@
 __FBSDID("$FreeBSD: src/lib/libatm/atm_addr.c,v 1.8 2002/06/24 22:29:01 arr Exp $");
 #ifndef lint
 #if 0	/* original (broken) import id */
-static char *RCSid = "@(#) $Id: atm_addr.c,v 1.1 1998/07/09 21:45:18 johnc Exp $";
+static const char *RCSid = "@(#) $Id: atm_addr.c,v 1.1 1998/07/09 21:45:18 johnc Exp $";
 #endif
 #endif
 
@@ -305,7 +305,7 @@
 		u2.c[3] = atm_spans->aas_addr[7];
 
 		if (!(u1.w == 0 && u2.w == 0))
-			sprintf(str, "0x%08lx.%08lx", ntohl(u1.w), ntohl(u2.w));
+			sprintf(str, "0x%08x.%08x", ntohl(u1.w), ntohl(u2.w));
 		break;
 
 	case T_ATM_PVC_ADDR:
>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: Dan Lukes <dan@obluda.cz>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/42385: clean libatm code from warnings
Date: Wed, 4 Sep 2002 15:06:44 +1000 (EST)

 On Tue, 3 Sep 2002, Dan Lukes wrote:
 
 > >Description:
 > lib/libatm/atm_addr.c:
 >  308: warning: long unsigned int format, __uint32_t arg (arg 3)
 >                long unsigned int format, __uint32_t arg (arg 4)
 >      #>> ntohl (despite of 'l' in it's name)
 >      #>>   return uint32_t ( = __uint32_t = unsigned int )
 >      #>>   so 'l' modifier should not be used
 
 The format is correct.  ntohl() returns a typedefed type which may be
 u_long.  ntohl() still returns long or ulong on some systems like its
 name suggests.  The values should be cast to u_long since the type is
 unknown.  The type can be almost anything, but the values are known
 to be representable as u_longs.
 
 Bruce
 

From: Dan Lukes <dan@obluda.cz>
To: Bruce Evans <bde@zeta.org.au>
Cc: freebsd-gnats-submit@FreeBSD.org, dan@obluda.cz
Subject: Re: bin/42385: clean libatm code from warnings
Date: Wed, 04 Sep 2002 22:37:57 +0200

 Bruce Evans wrote:
 
 
 >>lib/libatm/atm_addr.c:
 >> 308: warning: long unsigned int format, __uint32_t arg (arg 3)
 >>               long unsigned int format, __uint32_t arg (arg 4)
 >>     #>> ntohl (despite of 'l' in it's name)
 >>     #>>   return uint32_t ( = __uint32_t = unsigned int )
 >>     #>>   so 'l' modifier should not be used
 > 
 > 
 > The format is correct.  ntohl() returns a typedefed type which may be
 > u_long.  ntohl() still returns long or ulong on some systems like its
 > name suggests.  The values should be cast to u_long since the type is
 > unknown.  The type can be almost anything, but the values are known
 > to be representable as u_longs.
 
 	You are true, we shouldn't remove the 'l' modifier, we should cast. So:
 
 --- lib/libatm/atm_addr.c.ORIG	Tue Jun 25 00:29:01 2002
 +++ lib/libatm/atm_addr.c	Tue Sep  3 23:11:38 2002
 @@ -28,7 +28,7 @@
   __FBSDID("$FreeBSD: src/lib/libatm/atm_addr.c,v 1.8 2002/06/24 22:29:01 arr Exp $");
   #ifndef lint
   #if 0	/* original (broken) import id */
 -static char *RCSid = "@(#) $Id: atm_addr.c,v 1.1 1998/07/09 21:45:18 johnc Exp $";
 +static const char *RCSid = "@(#) $Id: atm_addr.c,v 1.1 1998/07/09 21:45:18 johnc Exp $";
   #endif
   #endif
 
 @@ -305,7 +305,7 @@
   		u2.c[3] = atm_spans->aas_addr[7];
 
   		if (!(u1.w == 0 && u2.w == 0))
 - 
 		sprintf(str, "0x%08lx.%08lx", ntohl(u1.w), ntohl(u2.w));
 + 
 		sprintf(str, "0x%08lx.%08lx", (u_long) ntohl(u1.w), (u_long) ntohl(u2.w));
   		break;
 
   	case T_ATM_PVC_ADDR:
 
 
 							Dan
 
Responsible-Changed-From-To: freebsd-bugs->harti 
Responsible-Changed-By: harti 
Responsible-Changed-When: Fri May 9 03:17:32 PDT 2003 
Responsible-Changed-Why:  
I'll look at this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=42385 
State-Changed-From-To: open->closed 
State-Changed-By: harti 
State-Changed-When: Fri Jul 25 00:57:12 PDT 2003 
State-Changed-Why:  
This has been fixed in revision 1.9. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=42385 
>Unformatted:
