Re: [PATCH] Verify memory sizes on 32 bit systems.
From: Tobias Stoeckmann <hidden>
Date: 2018-08-03 21:51:35
From: Tobias Stoeckmann <hidden>
Date: 2018-08-03 21:51:35
On Fri, Aug 03, 2018 at 02:33:51PM -0700, Lucas De Marchi wrote:
so you are casting the *sign* away, ok. But casting only st.st_size should suffice.
I've just tried with some examples and I couldn't trigger the warning which I have seen in other situations like this, i.e. "always false due to limited range of data type". If I cast the off_t to size_t, the compiler knows that it is not possible that it could ever be larger than SIZE_MAX, optimizing the block away. So I took uintmax_t. But as long as there's no annoying warning, I am fine with just casting st_size. Tobias