Subject: kern/14163: subr_prop won't compile (size_t != long)
To: None <gnats-bugs@gnats.netbsd.org>
From: seebs <seebs@ged.plethora.net>
List: netbsd-bugs
Date: 10/05/2001 14:33:04
>Number: 14163
>Category: kern
>Synopsis: size_t isn't the same as long, so gcc barfs
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Oct 05 12:38:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: seebs
>Release: October 5, 2001
>Organization:
>Environment:
System: NetBSD ged.plethora.net 1.5Y NetBSD 1.5Y (GED) #0: Mon Sep 24 11:34:20 CDT 2001 seebs@ged.plethora.net:/usr/src/sys/arch/i386/compile/GED i386
Architecture: i386
Machine: i386
>Description:
---
cc1: warnings being treated as errors
../../../../kern/subr_prop.c: In function `allocprop':
../../../../kern/subr_prop.c:122: warning: long int format, int arg
(arg 2)
../../../../kern/subr_prop.c: In function `prop_set':
../../../../kern/subr_prop.c:341: warning: long unsigned int format,
size_t arg (arg 6)
../../../../kern/subr_prop.c: In function `prop_get':
../../../../kern/subr_prop.c:415: warning: long unsigned int format,
size_t arg (arg 6)
../../../../kern/subr_prop.c: In function `prop_objs':
../../../../kern/subr_prop.c:456: warning: long unsigned int format,
size_t arg (arg 4)
../../../../kern/subr_prop.c: In function `prop_list':
../../../../kern/subr_prop.c:483: warning: long unsigned int format,
size_t arg (arg 5)
---
>How-To-Repeat:
Make kernel
>Fix:
Ugly, but probably correct.
*** subr_prop.c.orig Fri Oct 5 14:30:38 2001
--- subr_prop.c Fri Oct 5 14:31:34 2001
***************
*** 118,124 ****
nsize = ALIGN(strlen(name));
DPRINTF(x, ("allocprop: allocating %ld bytes for %s %s\n",
! sizeof(struct kdbprop) + dsize + nsize, name,
wait ? "can wait" : "can't wait"));
kp = (struct kdbprop *)malloc(sizeof(struct kdbprop) + dsize + nsize,
--- 118,124 ----
nsize = ALIGN(strlen(name));
DPRINTF(x, ("allocprop: allocating %ld bytes for %s %s\n",
! (long) (sizeof(struct kdbprop) + dsize + nsize), name,
wait ? "can wait" : "can't wait"));
kp = (struct kdbprop *)malloc(sizeof(struct kdbprop) + dsize + nsize,
***************
*** 338,344 ****
int s;
DPRINTF(x, ("prop_set: %p, %p, %s, %p, %lx, %x, %d\n", db, object,
! name ? name : "NULL", val, len, type, wait));
/* Find our object */
s = splvm();
--- 338,344 ----
int s;
DPRINTF(x, ("prop_set: %p, %p, %s, %p, %lx, %x, %d\n", db, object,
! name ? name : "NULL", val, (unsigned long) len, type, wait));
/* Find our object */
s = splvm();
***************
*** 412,418 ****
int s;
DPRINTF(x, ("prop_get: %p, %p, %s, %p, %lx, %p\n", db, object,
! name ? name : "NULL", val, len, type));
/* Find our object */
s = splvm();
--- 412,418 ----
int s;
DPRINTF(x, ("prop_get: %p, %p, %s, %p, %lx, %p\n", db, object,
! name ? name : "NULL", val, (unsigned long) len, type));
/* Find our object */
s = splvm();
***************
*** 453,459 ****
struct kdbobj *obj;
int i, j, s, nelem = (len / sizeof(opaque_t));
! DPRINTF(x, ("prop_objs: %p, %p, %lx\n", db, objects, len));
s = splvm();
for (i=0, j=0; i < db->kd_size; i++) {
--- 453,459 ----
struct kdbobj *obj;
int i, j, s, nelem = (len / sizeof(opaque_t));
! DPRINTF(x, ("prop_objs: %p, %p, %lx\n", db, objects, (unsigned long) len));
s = splvm();
for (i=0, j=0; i < db->kd_size; i++) {
***************
*** 480,486 ****
int s, i = 0;
DPRINTF(x, ("prop_list: %p, %p, %p, %lx\n",
! db, object, names, len));
/* Find our source object */
s = splvm();
--- 480,486 ----
int s, i = 0;
DPRINTF(x, ("prop_list: %p, %p, %p, %lx\n",
! db, object, names, (unsigned long) len));
/* Find our source object */
s = splvm();
>Release-Note:
>Audit-Trail:
>Unformatted: