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 2/7] Remove vlang_unknown


On Tue, Oct 1, 2013 at 6:32 AM, Yao Qi <yao@codesourcery.com> wrote:
> On 10/01/2013 06:07 PM, Joel Brobecker wrote:
>>
>> I am not really sure why the first enum would need to be zero.
>> If we cannot find an answer to that question, I propose you leave
>> the "= 0" out of this patch.
>
>
> 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.


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