[PATCH 0/2] [PUSHED/OBV] gas/arc: Add nps400 support to .cpu directive

Nick Clifton nickc@redhat.com
Wed Apr 20 09:23:00 GMT 2016


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



More information about the Binutils mailing list