Subject: Re: CVS commit: src/sys/dist/ipf/netinet
To: None <mrg@eterna.com.au>
From: Havard Eidnes <he@uninett.no>
List: source-changes
Date: 02/09/2005 22:27:37
>    Log Message:
>    One can't portably print a size_t with an %u format directive.
>    Since this might be in the kernel, cast to unsigned int before pri=
nting.
>    Fixes build problem for amd64 (and presumably also our other LP64 =
ports).
>
> since size_t is "unsigned long" on some platforms, casting
> to int seems not really right (though i'd hope it wouldn't
> actually matter.)  maybe just use %z format instead?

It's the size of a struct, so "unsigned long" vs "unsigned int"
should not matter.

I don't think %z can be used, because this might be in the
kernel, and I don't think that format specifier is available
there.

Besides, this is third-party software, and %z isn't necessarily
available on all the target platforms for the package, and there
is a point to minimizing the local differences.  (Yes, I've
forwarded the patches to the author, at least his @netbsd.org
address.)

Regards,

- H=E5vard