diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-09-24 22:38:22 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-09-24 22:38:22 +0000 |
commit | 0be2ebc785cd4b366423534d0bfdce0499483e80 (patch) | |
tree | 7ec3b888341991cdf8a157f5d87a6dea617363e5 /include/libiberty.h | |
parent | 347e5e07ef4db24f295a4513b381bbb943ddf9f4 (diff) | |
download | gcc-0be2ebc785cd4b366423534d0bfdce0499483e80.tar.gz |
include:
* libiberty.h (reconcat): New function.
libiberty:
* concat.c (reconcat): New function.
gcc:
* c-aux-info.c (affix_data_type): Use ATTRIBUTE_MALLOC. Avoid
leak by passing malloc'ed pointer to reconcat, not concat.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45789 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'include/libiberty.h')
-rw-r--r-- | include/libiberty.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/libiberty.h b/include/libiberty.h index a54e3adf05e..315d3106c4b 100644 --- a/include/libiberty.h +++ b/include/libiberty.h @@ -91,6 +91,15 @@ extern const char *lbasename PARAMS ((const char *)); extern char *concat PARAMS ((const char *, ...)) ATTRIBUTE_MALLOC; +/* Concatenate an arbitrary number of strings. You must pass NULL as + the last argument of this function, to terminate the list of + strings. Allocates memory using xmalloc. The first argument is + not one of the strings to be concatenated, but if not NULL is a + pointer to be freed after the new string is created, similar to the + way xrealloc works. */ + +extern char *reconcat PARAMS ((char *, const char *, ...)) ATTRIBUTE_MALLOC; + /* Determine the length of concatenating an arbitrary number of strings. You must pass NULL as the last argument of this function, to terminate the list of strings. */ |