From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 100431 invoked by alias); 25 Jun 2017 10:48:34 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 85306 invoked by uid 89); 25 Jun 2017 10:48:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=preview, our X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 25 Jun 2017 10:48:04 +0000 Received: by simark.ca (Postfix, from userid 33) id E14C61E561; Sun, 25 Jun 2017 06:48:02 -0400 (EDT) To: Pedro Alves Subject: Re: [PATCH 3/4] dtrace-probe: Put semicolon after while on its own line X-PHP-Originating-Script: 33:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 25 Jun 2017 10:48:00 -0000 From: Simon Marchi Cc: Simon Marchi , gdb-patches@sourceware.org In-Reply-To: <2ea4d9d1-5434-6b87-91d0-924ef6e0fb90@redhat.com> References: <1498076108-29914-1-git-send-email-simon.marchi@ericsson.com> <1498076108-29914-4-git-send-email-simon.marchi@ericsson.com> <2ea4d9d1-5434-6b87-91d0-924ef6e0fb90@redhat.com> Message-ID: <9cada962c73394285f820d1304db9608@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.2.5 X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg00682.txt.bz2 On 2017-06-21 23:36, Pedro Alves wrote: > 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. Ok, since that's already a common practice in our codebase, I added it to our wiki (I didn't find anything related to that in the GNU standards): https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards#preview I am pushing without the comment. Thanks, Simon