On 11-10-18 13:56, Gert Doering wrote:
> On Thu, Oct 11, 2018 at 01:52:37PM +0200, Steffan Karger wrote:
>>> I know that Steffan likes using size_t for "things that have a size"
>>> but I find it a bit questionable here :-)
>>
>> So the underlying problem is that "further down" used int to store
>> sizes, but since that just is the way it is and we shouldn't pull in
>> refactoring the code base for each small change, I would say either make
>> both 'int', or make both 'size_t', but without changing the types of
>> struct frame itself.  I of course prefer the latter ;-)
> 
> Adding or substracting a size_t from frame->extra_frame (which is an int)
> will quite likely cause the same warning again...

I don't think so, because at that level, you'll be adding/subtracting
either "int + int" or "int + size_t", which are equally likely to cause
overflows. Only that signed overflows are not only not what you want,
but also undefined behaviour.

But well, as I said, I'm fine with both in this case. It will
effectively not change any logic anyway.

-Steffan


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to