From: hainque Date: Tue, 3 Jan 2012 11:36:25 +0000 (+0000) Subject: * collect2.c (main): In AIX specific computations for vector X-Git-Tag: upstream/4.9.2~15178 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e4e4eb40024c4b7c41335e42ffbd54a3e826744f;p=platform%2Fupstream%2Flinaro-gcc.git * collect2.c (main): In AIX specific computations for vector insertions, use CONST_CAST2 to cast from char ** to const char **. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182836 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1c21031..c95a7ef 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2012-01-03 Olivier Hainque + + * 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 PR debug/51650 diff --git a/gcc/collect2.c b/gcc/collect2.c index 92ef7ba..a44b2e7 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -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);