[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [PATCH] compiler: add a sizeof_field() macro
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-ppc] [Qemu-devel] [PATCH] compiler: add a sizeof_field() macro |
Date: |
Fri, 15 Jun 2018 08:59:34 +0100 |
On Thu, Jun 14, 2018 at 9:33 PM, Philippe Mathieu-Daudé <address@hidden> wrote:
> On 06/14/2018 04:17 PM, John Snow wrote:
>> On 06/14/2018 12:44 PM, Stefan Hajnoczi wrote:
>>> Determining the size of a field is useful when you don't have a struct
>>> variable handy. Open-coding this is ugly.
>>>
>>> This patch adds the sizeof_field() macro, which is similar to
>>> typeof_field(). Existing instances are updated to use the macro.
>>>
>>> Signed-off-by: Stefan Hajnoczi <address@hidden>
>>
>> How'd you find all the existing instances?
>
> This works:
>
> $ git grep -E 'sizeof.*)0)->'
Yes, I used a similar grep command-line.
I also checked for "sizeof.*)NULL" but nothing uses that syntax.
Stefan