collect2.c (main): In AIX specific computations for vector insertions...

* collect2.c (main): In AIX specific computations for vector
        insertions, use CONST_CAST2 to cast from char ** to const char **.

From-SVN: r182836
This commit is contained in:
Olivier Hainque 2012-01-03 11:36:25 +00:00 committed by Olivier Hainque
parent f3321fd715
commit 6588d71129
2 changed files with 10 additions and 2 deletions

View 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

View 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);