This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 0/2] [PUSHED/OBV] gas/arc: Add nps400 support to .cpu directive
- From: Nick Clifton <nickc at redhat dot com>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>
- Cc: Claudiu Zissulescu <claziss at gmail dot com>, Binutils <binutils at sourceware dot org>, Claudiu Zissulescu <Claudiu dot Zissulescu at synopsys dot com>, Cupertino Miranda <Cupertino dot Miranda at synopsys dot com>
- Date: Wed, 20 Apr 2016 10:23:38 +0100
- Subject: Re: [PATCH 0/2] [PUSHED/OBV] gas/arc: Add nps400 support to .cpu directive
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1460822027 dot git dot andrew dot burgess at embecosm dot com> <CAL0iMy1eDXHNYZS_B=zNvV+FMnp09yPHo2gxYLTiHEYgk=LG+A at mail dot gmail dot com> <20160417203517 dot GC6589 at embecosm dot com> <CAL0iMy0iDrUA_2U1WDnsym1z6a-wATDWyY932Mr5maK5dt_dPg at mail dot gmail dot com> <20160417223058 dot GD6589 at embecosm dot com> <5714C000 dot 7080505 at redhat dot com> <20160419185401 dot GH6589 at embecosm dot com>
Hi Andrew,
> gas/ChangeLog:
>
> * config/tc-arc.c (MAX_NUMBER_OF_ALIASES): Define.
> (struct cpu_type): Add aliases member, convert string points to
> NULL instead of 0.
> (cpu_types): Fill in the aliases field.
> (arc_handle_cpu_option_string): New function.
> (arc_option): Use arc_handle_cpu_option_string to process the
> option.
> (arc_show_cpu_list): New function.
> (md_show_usage): Call arc_show_cpu_list. Convert help text to
> lower case to match all other help text. Remove use of tabs,
> inline with global help text.
Approved - please apply.
Note:
> + const char *alises [MAX_NUMBER_OF_ALIASES + 1];
You could set the this just [MAX_NUMBERR_OF_ALIASES] and then ...
> + for (j = 0; cpu_types[i].alises[j] != NULL; ++j)
test for i < MAX_NUMBER_OF_ALIASES as well as a NULL alias.
Which would save a very small amount of space and is probably
not worth it. But it just struck me as odd that you would create
an array with MAX + 1 elements in it.
Cheers
Nick