[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [SCM] dpkg's main repository branch, parsechangelog, updated. 1.14.12-36-g2d2cda5



Ian Jackson <ian@davenant.greenend.org.uk> writes:
> Frank Lichtenheld writes ("[SCM] dpkg's main repository branch, parsechangelog, updated.  1.14.12-36-g2d2cda5"):
>> Summary of changes:
> ...
>>  dpkg-deb/info.c                  |    2 +-
> ...
>> + 2007-12-04  Frank Lichtenheld  <djpig@debian.org>
>> + 
>> + 	* dpkg-deb/info.c (info_spew): Replace a
>> + 	%ld with %lu to fix compiler warning.
> ...
>
> However, the attached diff doesn't seem to have this change.
>
> I assume this is a reference to this:
>       ohshite(_("realloc failed (%ld bytes)"), pathlen);
>
> However changing %ld to %lu is still not correct because the actual
> type of pathlen (which is a size_t) isn't known.
>
> This should read:
>       ohshite(_("realloc failed (%lu bytes)"), (unsigned long)pathlen);
> or the corresponding thing with %ld and (long) - I think we can safely
> assume that pathlen will be <= LONG_MAX.

I wonder if we're at the point yet where we can use %zu, per C99, and
avoid the cast.  It would certainly work on Linux.

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>


Reply to: