This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/4] dtrace-probe: Put semicolon after while on its own line


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]