diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-01-03 01:30:32 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2016-01-05 15:25:13 -0500 |
commit | b36c1ccb1feb678f7279b4a8d66c0125d4295078 (patch) | |
tree | 3739015b75cd944eecae804145791ad650581706 /include | |
parent | 203217665139943a4f0d1797b9a5f913b3acf184 (diff) | |
download | gdb-b36c1ccb1feb678f7279b4a8d66c0125d4295078.zip gdb-b36c1ccb1feb678f7279b4a8d66c0125d4295078.tar.gz gdb-b36c1ccb1feb678f7279b4a8d66c0125d4295078.tar.bz2 |
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.
Diffstat (limited to 'include')
-rw-r--r-- | include/ChangeLog | 5 | ||||
-rw-r--r-- | include/libiberty.h | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index 70e19b7..07c24d3 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,8 @@ +2016-01-05 Mike Frysinger <vapier@gentoo.org> + + * libiberty.h (dupargv): Change arg to char * const *. + (writeargv, countargv): Likewise. + 2016-01-01 Alan Modra <amodra@gmail.com> Update year range in copyright notice of all files. diff --git a/include/libiberty.h b/include/libiberty.h index 6aa8700..8f7d5f6 100644 --- a/include/libiberty.h +++ b/include/libiberty.h @@ -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 |