summaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-26 14:26:25 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-26 14:26:25 +0000
commit80df9a94b9cf67b4fa68a36d85d5f0cbe2a1c350 (patch)
tree80c6cecfbcd2d76ae5b9d7f2fb065906ae589222 /libiberty
parent597cee6acc82faab48570bc740881985e0c53c11 (diff)
downloadgcc-80df9a94b9cf67b4fa68a36d85d5f0cbe2a1c350.tar.gz
* make-relative-prefix.c (make_relative_prefix_1): Avoid warning
about using preprocessor directives inside of macro arguments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183561 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog5
-rw-r--r--libiberty/make-relative-prefix.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 1e9b95aa397..5f492cc3978 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,8 @@
+2012-01-26 Jakub Jelinek <jakub@redhat.com>
+
+ * make-relative-prefix.c (make_relative_prefix_1): Avoid warning
+ about using preprocessor directives inside of macro arguments.
+
2012-01-22 Douglas B Rupp <rupp@gnat.com>
* configure: Regenerate.
diff --git a/libiberty/make-relative-prefix.c b/libiberty/make-relative-prefix.c
index 7239e7b0bae..fe639d18bd2 100644
--- a/libiberty/make-relative-prefix.c
+++ b/libiberty/make-relative-prefix.c
@@ -248,14 +248,15 @@ make_relative_prefix_1 (const char *progname, const char *bin_prefix,
{
char *startp, *endp, *nstore;
size_t prefixlen = strlen (temp) + 1;
+ size_t len;
if (prefixlen < 2)
prefixlen = 2;
- nstore = (char *) alloca (prefixlen + strlen (progname) + 1
+ len = prefixlen + strlen (progname) + 1;
#ifdef HAVE_HOST_EXECUTABLE_SUFFIX
- + strlen (HOST_EXECUTABLE_SUFFIX)
+ len += strlen (HOST_EXECUTABLE_SUFFIX);
#endif
- );
+ nstore = (char *) alloca (len);
startp = endp = temp;
while (1)