summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorvapier <vapier@138bc75d-0d04-0410-961f-82ee72b054a4>2016-01-05 20:23:30 +0000
committervapier <vapier@138bc75d-0d04-0410-961f-82ee72b054a4>2016-01-05 20:23:30 +0000
commite2e4b9a0b88f75f6b354ca217ec5e296f737a5d5 (patch)
treee33cdcaa1dabbad9bd07bef692c837f46907a560 /include
parent233a53ed985a0f91c5d9ff5c99f89bec592cc51b (diff)
downloadgcc-e2e4b9a0b88f75f6b354ca217ec5e296f737a5d5.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232089 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog5
-rw-r--r--include/libiberty.h6
2 files changed, 8 insertions, 3 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index d74a9bbf733..6d1264845b5 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.
+
2015-11-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* vtv-change-permission.h (VTV_PAGE_SIZE) [__sun__ && __svr4__ &&
diff --git a/include/libiberty.h b/include/libiberty.h
index 8e096a0db0c..a9c885fc670 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