From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24983 invoked by alias); 2 Oct 2013 09:32:52 -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 24973 invoked by uid 89); 2 Oct 2013 09:32:52 -0000 Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 02 Oct 2013 09:32:52 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 801DE11650D; Wed, 2 Oct 2013 05:33:08 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 04TUZoGXfIjA; Wed, 2 Oct 2013 05:33:08 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 5B99611635C; Wed, 2 Oct 2013 05:33:08 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 6BF03E0D39; Wed, 2 Oct 2013 11:32:48 +0200 (CEST) Date: Wed, 02 Oct 2013 09:32:00 -0000 From: Joel Brobecker To: Doug Evans Cc: Yao Qi , gdb-patches Subject: Re: [PATCH 2/7] Remove vlang_unknown Message-ID: <20131002093248.GB2971@adacore.com> References: <1379512482-31773-1-git-send-email-yao@codesourcery.com> <1379512482-31773-3-git-send-email-yao@codesourcery.com> <20131001100742.GC2840@adacore.com> <524ACF04.2050904@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2013-10/txt/msg00087.txt.bz2 > > In varobj.c:varobj_create, variable_language returns > > 'enum varobj_languages', and use it as an index to array > > languages. > > > > /* Set language info */ > > lang = variable_language (var); > > var->root->lang = &languages[lang]; > > > > that is the reason the first enum should be zero. > > While we know enums begin at zero, making it explicit is fine with me. > > But if there's a reason that needed explaining, a comment in the code > explaining "Why things are the way they are" > is most welcome. I agree. I think the patch is OK to go with a quick comment added, explaining that we want to be able to index arrays using this enum, so we make its first enum explicitly zero (despite the fact that this is the default, this prevents someone else just accidently setting the first enum's value to nonzero for other reasons). -- Joel