Re: [PATCH 45/72] libmultipath: fix -Wsign-compare warnings with snprintf()

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

 



On 2019-10-22 13:34, Martin Wilck wrote:
> Most uses of snprintf() are in libmultipath printing code, where items
> are printed sequentially into a big buffer, advancing the buffer
> pointer on the way. asprintf() doesn't match that use case well,
> AFAICS. But in some other places, switching to asprintf would certainly
> make sense. Anyway, I'd like to do that in a separate patch set if you
> don't mind; this one is big enough already.

Hi Martin,

For this patch, have you considered to change the type of the 'bufsiz'
argument of format_partname() from size_t into int or unsigned int? I do
not expect that the output string will ever exceed 65535 characters. As
you probably know the C standard guarantees that there are at least 16
bits in an int.

I'd like to reiterate that introducing -Wsign-compare seems dubious to me.

Thanks,

Bart.

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel





[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux