This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/4] dtrace-probe: Put semicolon after while on its own line
- From: Pedro Alves <palves at redhat dot com>
- To: Simon Marchi <simon dot marchi at ericsson dot com>, gdb-patches at sourceware dot org
- Date: Wed, 21 Jun 2017 22:36:13 +0100
- Subject: Re: [PATCH 3/4] dtrace-probe: Put semicolon after while on its own line
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 56F1E7F40E
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 56F1E7F40E
- References: <1498076108-29914-1-git-send-email-simon.marchi@ericsson.com> <1498076108-29914-4-git-send-email-simon.marchi@ericsson.com>
On 06/21/2017 09:15 PM, Simon Marchi wrote:
> /* Use strtab_size as a sentinel. */
> - while (*p++ != '\0' && p - strtab < strtab_size);
> + while (*p++ != '\0' && p - strtab < strtab_size)
> + ; /* Silence clang's -Wempty-body warning. */
I'd must put the ; on its own line (there's probably something
in the coding conventions about this already), and without the
comment. It's quite common to write for/while loop like that,
see e.g.,:
$ grep "^[ |\t]*;[ |\t]*$" *.c -C 2
Sure the comment makes sense in the context of the patch,
but when reading the code without considering the patch's context,
it just looks like noise to me.
Thanks,
Pedro Alves