This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Change maxsize_* and last_* from size_t to uint64_t in memusagestat.c
- From: Holger Freyther <zecke at selfish dot org>
- To: libc-help at sourceware dot org
- Date: Sun, 1 Nov 2009 05:51:06 +0100
- Subject: Re: [PATCH] Change maxsize_* and last_* from size_t to uint64_t in memusagestat.c
- References: <email@example.com> <firstname.lastname@example.org>
On Saturday 31 October 2009 21:58:49 Carlos O'Donell wrote:
> On Fri, Oct 30, 2009 at 9:45 AM, Holger Freyther <email@example.com> wrote:
> > 2009-10-30 Holger Hans Peter Freyther <firstname.lastname@example.org>
> > * malloc/memusagestat.c (main): Change the type from size_t to
> > uint64_t in maxsize_heap, maxsize_stack, maxsize_total, last_heap,
> > last_stack, last_total to avoid assigning from an unsigned to a signed
> > type.
> Same problem as before with your ChangeLog.
> The comment is also incorrect. The type size_t is by definition
> unsigned, therefore there should be no assignment from a signed to
> unsigned type.
My bad, I was thinking of ssize_t when writing it.
> What is the actual error message you were seeing?
I was probably trying to fix this and my first step was to fix things that
looked broken to me. I have not seen any compiler warning about possible
trunication though. I think it is safe and sane to use uint64_t instead of
size_t. In one way it feels more natural as struct entry is using it (as you