[prev in list] [next in list] [prev in thread] [next in thread]
List: wireshark-dev
Subject: Re: [Wireshark-dev] size_t vs int
From: Guy Harris <guy () alum ! mit ! edu>
Date: 2015-09-04 17:22:36
Message-ID: 3073D8A6-3FE1-411C-9692-C7F598BABA21 () alum ! mit ! edu
[Download RAW message or body]
On Sep 4, 2015, at 6:46 AM, Dario Lombardo <dario.lombardo.ml@gmail.com> wrote:
> The first possibility is to change the "lowest" function, to keep the current \
> prototype but with some integer checks and casts.
> The second possibility is to "sanitize" the lowest function (in the example above, \
> AFAIK, there is no reason to have int as input/output, better have size_t), but \
> this, like a domino effect, requires to change the calling function (in the \
> example, change the codec_decode_fn typedef) that propagates the change to other \
> functions and so on.
> The first has less impact, but is more dirty. The second has great impact, but is \
> more correct/elegant.
> What do you think?
I vote for the second change. Object sizes in C code should be represented as \
size_t.
___________________________________________________________________________
Sent via: Wireshark-dev mailing list <wireshark-dev@wireshark.org>
Archives: https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
mailto:wireshark-dev-request@wireshark.org?subject=unsubscribe
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic