libiberty: {count,dup,write}argv: constify argv input slightly

Would be more useful if we could use "const char * const *", but there's
a long standing bug where gcc warns about incompatible pointers when you
try to pass in "char **".  We can at least constify the array itself as
gcc will not warn in that case.
This commit is contained in:
Mike Frysinger
2016-01-03 01:30:32 -05:00
parent 2032176651
commit b36c1ccb1f
5 changed files with 23 additions and 12 deletions

View File

@@ -80,7 +80,7 @@ extern void freeargv (char **);
/* Duplicate an argument vector. Allocates memory using malloc. Use
freeargv to free the vector. */
extern char **dupargv (char **) ATTRIBUTE_MALLOC;
extern char **dupargv (char * const *) ATTRIBUTE_MALLOC;
/* Expand "@file" arguments in argv. */
@@ -88,11 +88,11 @@ extern void expandargv (int *, char ***);
/* Write argv to an @-file, inserting necessary quoting. */
extern int writeargv (char **, FILE *);
extern int writeargv (char * const *, FILE *);
/* Return the number of elements in argv. */
extern int countargv (char**);
extern int countargv (char * const *);
/* Return the last component of a path name. Note that we can't use a
prototype here because the parameter is declared inconsistently