* make-relative-prefix.c (make_relative_prefix_1): Avoid warning
authorJakub Jelinek <jakub@redhat.com>
Thu, 26 Jan 2012 14:28:31 +0000 (14:28 +0000)
committerJakub Jelinek <jakub@redhat.com>
Thu, 26 Jan 2012 14:28:31 +0000 (14:28 +0000)
about using preprocessor directives inside of macro arguments.

libiberty/ChangeLog
libiberty/make-relative-prefix.c

index 1e9b95aa397211640f7b84b468600227e7fb78cc..5f492cc3978e11bdee8cef8a4cff718ca64247d4 100644 (file)
@@ -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.
index 7239e7b0bae2d98c8f201775f63ffc4073526647..fe639d18bd2815a5ec33aef28720386725ab1bd5 100644 (file)
@@ -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)