This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 3/3] Add test for thread names
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: Pedro Alves <palves at redhat dot com>, <gdb-patches at sourceware dot org>
- Date: Thu, 26 Nov 2015 13:21:37 -0500
- Subject: Re: [PATCH v2 3/3] Add test for thread names
- Authentication-results: sourceware.org; auth=none
- References: <1448488138-2360-1-git-send-email-simon dot marchi at ericsson dot com> <1448488138-2360-4-git-send-email-simon dot marchi at ericsson dot com> <5656F0C2 dot 4070203 at redhat dot com> <56572C7F dot 3030101 at ericsson dot com> <565739F1 dot 2010005 at redhat dot com>
On 15-11-26 11:57 AM, Pedro Alves wrote:
> On 11/26/2015 03:59 PM, Simon Marchi wrote:
>
>> I modified names.c significantly, so could you give it another quick look?
>
> Looks great, thanks.
>
>> + /* Make sure that NAMES contains NUM_THREADS elements. */
>> + assert (sizeof (names) == sizeof (names[0]) * NUM_THREADS);
>
> BTW, the standard pattern would be:
>
> assert (sizeof (names) / sizeof (names[0]) == NUM_THREADS);
You are right, it's better like that.
> which at least my brain processes immediately like ARRAY_SIZE,
> while with the * form, I have to stop and think.
>
> Thanks,
> Pedro Alves
Pushed, thanks!