collect2.c (main): In AIX specific computations for vector insertions...
authorOlivier Hainque <hainque@adacore.com>
Tue, 3 Jan 2012 11:36:25 +0000 (11:36 +0000)
committerOlivier Hainque <hainque@gcc.gnu.org>
Tue, 3 Jan 2012 11:36:25 +0000 (11:36 +0000)
        * collect2.c (main): In AIX specific computations for vector
        insertions, use CONST_CAST2 to cast from char ** to const char **.

From-SVN: r182836

gcc/ChangeLog
gcc/collect2.c

index 1c21031a0e5439dd6d165337547a0bde8637d6cd..c95a7ef05b79189048f9820d287f86e168e44e3f 100644 (file)
@@ -1,3 +1,8 @@
+2012-01-03  Olivier Hainque  <hainque@adacore.com>
+
+       * collect2.c (main): In AIX specific computations for vector
+       insertions, use CONST_CAST2 to cast from char ** to const char **.
+
 2012-01-03  Richard Guenther  <rguenther@suse.de>
 
        PR debug/51650
index 92ef7ba024e45d7c0b085b743e055b80d1204fc9..a44b2e7bc848f4d4c0fe0550eaca82484e4f5068 100644 (file)
@@ -1481,11 +1481,14 @@ main (int argc, char **argv)
                         extra space for remaining arguments.  */
                      if (add_nbr >= add_max)
                        {
-                         int pos = object - (const char **)object_lst;
+                         int pos =
+                           object - CONST_CAST2 (const char **, char **,
+                                                 object_lst);
                          add_max = (add_max == 0) ? 16 : add_max * 2;
                          object_lst = XRESIZEVEC (char *, object_lst,
                                                    object_nbr + add_max);
-                         object = (const char **) object_lst + pos;
+                         object = CONST_CAST2 (const char **, char **,
+                                               object_lst) + pos;
                          object_nbr += add_max;
                        }
                      *object++ = xstrdup (buf);