diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f1ea47ce04e..08dffb0122f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-07-16 Olivier Hainque + + * collect2.c (scan_prog_file, COFF version): Use CONST_CAST + instead of bare conversion to cast const-ness away. + 2008-07-16 Anatoly Sokolov * config/xtensa/xtensa.h (FUNCTION_OUTGOING_VALUE, diff --git a/gcc/collect2.c b/gcc/collect2.c index 314d30d7717..713c8f2d562 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -2476,8 +2476,8 @@ scan_prog_file (const char *prog_name, enum pass which_pass) /* Some platforms (e.g. OSF4) declare ldopen as taking a non-const char * filename parameter, even though it will not modify that string. So we must cast away const-ness here, - which will cause -Wcast-qual to burp. */ - if ((ldptr = ldopen ((char *)prog_name, ldptr)) != NULL) + using CONST_CAST to prevent complaints from -Wcast-qual. */ + if ((ldptr = ldopen (CONST_CAST (char *, prog_name), ldptr)) != NULL) { if (! MY_ISCOFF (HEADER (ldptr).f_magic)) fatal ("%s: not a COFF file", prog_name);