From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21766 invoked by alias); 29 Jun 2008 17:49:20 -0000 Received: (qmail 21757 invoked by uid 22791); 29 Jun 2008 17:49:20 -0000 X-Spam-Check-By: sourceware.org Received: from mtaout7.012.net.il (HELO mtaout7.012.net.il) (84.95.2.19) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 29 Jun 2008 17:48:56 +0000 Received: from HOME-C4E4A596F7 ([80.230.31.196]) by i-mtaout7.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0K3800IT4JCGT4L0@i-mtaout7.012.net.il> for gdb-patches@sources.redhat.com; Sun, 29 Jun 2008 20:31:29 +0300 (IDT) Date: Sun, 29 Jun 2008 19:42:00 -0000 From: Eli Zaretskii Subject: Re: [MI non-stop 04/11] Implement --thread and --frame. In-reply-to: <200806291003.28226.vladimir@codesourcery.com> X-012-Sender: halo1@inter.net.il To: Vladimir Prus Cc: marc.khouzam@ericsson.com, gdb-patches@sources.redhat.com Reply-to: Eli Zaretskii Message-id: References: <200806282044.14246.vladimir@codesourcery.com> <6D19CA8D71C89C43A057926FE0D4ADAA04E1BD85@ecamlmw720.eamcs.ericsson.se> <200806291003.28226.vladimir@codesourcery.com> X-IsSubscribed: yes 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 X-SW-Source: 2008-06/txt/msg00580.txt.bz2 > From: Vladimir Prus > Date: Sun, 29 Jun 2008 10:03:27 +0400 > Cc: gdb-patches@sources.redhat.com > > > char* threadStr = "--thread "; > > int len = strlen(threadStr); > > This is nice bikeshed question :-) Personally, I find that what I have is > perfectly maintainable, due to GNU Emacs having Esc-= shortcut -- which > counts the number of characters in a region. I think the variant with threadStr[] and sizeof - 1 is more maintainable, especially since not everyone uses Emacs. Moreover, a literal constant makes code a bit harder to read, since I need to count characters after you, to be sure I understand exactly what your code does. Granted, it's a minor nit, but then so are our indentation and whitespace rules. (Btw, in stock Emacs "ESC =" counts _lines_ in region, not characters. You probably have some customization that does this.)