From bb95b4e7ca83d3107dafb439dbe64f3cb704baf8 Mon Sep 17 00:00:00 2001 From: Olivier Hainque Date: Wed, 16 Jul 2008 16:20:31 +0000 Subject: [PATCH] collect2.c (scan_prog_file, [...]): Use CONST_CAST instead of bare conversion to cast const-ness away. * collect2.c (scan_prog_file, COFF version): Use CONST_CAST instead of bare conversion to cast const-ness away. From-SVN: r137889 --- gcc/ChangeLog | 5 +++++ gcc/collect2.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f1ea47c..08dffb0 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 314d30d..713c8f2 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); -- 2.7.4