[PATCH v3] vhost: fix build issues with GCC 12
Maxime Coquelin
maxime.coquelin at redhat.com
Thu Oct 6 09:51:29 CEST 2022
Hi Stephen,
On 10/6/22 02:01, Stephen Hemminger wrote:
> On Wed, 5 Oct 2022 22:35:24 +0200
> Maxime Coquelin <maxime.coquelin at redhat.com> wrote:
>
>> In practice, it would never happen since 'pkt->pkt_len' is
>> unlikely to be close to UINT32_MAX, but let's just change
>> 'size' to uint64_t to make the compiler happy without
>> having to add runtime checks.
>
>
> Would the standard typedef size_t work since that is what sizeof() returns.
>
I'm not sure it would not create issues on 32 bits architectures build
given size_t is 32bits in this case if I'm not mistaken, as it adds
something to a u32, so it could wrap to 0.
More information about the stable
mailing list