commands: allow <cmd>_aliases[] to be const
Commands with aliases define an array of alias strings such as:

  static const char *<cmd>_aliases[] = { "<alias1>", NULL};

Although the elements are of type `const char *`, the elements
themselves are not `const`-qualified.  If the array is declared as:

  static const char * const <cmd>_aliases[] = { "<alias1>", NULL};

then the compiler warns about const qualifiers being discarded.  This is
because the `aliases` member of `struct command` is declared as `const
char *aliases;`.

Change the declaration of the `aliases` member of `struct command` to
`const char * const *aliases;` so that it can point to a `const` array
of `const char *`.  Also change the declaration of the `aliases`
variable in `register_command()` to avoid unnecessary type casts.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 495111d commit f6652e7404ba4f10923227c75da4db4c86b1275e
@Ian Abbott Ian Abbott authored on 17 May 2017
Sascha Hauer committed on 19 May 2017
Showing 2 changed files
View
common/command.c
View
include/command.h