subversion-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Martin <philip.mar...@wandisco.com>
Subject Re: Review of sizeof usage
Date Thu, 13 Aug 2015 10:17:40 GMT
Stefan Fuhrmann <stefan.fuhrmann@wandisco.com> writes:

>> I prefer the explicit type as it is easier to grep.
>
> What do you grep for, specifically? The type should
> already show up for the variable / function argument
> declaration - so, you should not miss a type usage
> either way.

If I want to find all the locations that a given type is allocated then
using grep is hard on code like this:

    type_t *p;
    ...
    p = apr_palloc(result_pool, *p);

and this:

    void foo(type_t **p, apr_pool_t *pool)
    {
       *p = apr_palloc(pool, **p);
    }

Finding sizeof(type_t) is easier.

-- 
Philip Martin
WANdisco

Mime
View raw message