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
This commit is contained in:
Olivier Hainque 2008-07-16 16:20:31 +00:00 committed by Olivier Hainque
parent e2b2d01ef1
commit bb95b4e7ca
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2008-07-16 Olivier Hainque <hainque@adacore.com>
* collect2.c (scan_prog_file, COFF version): Use CONST_CAST
instead of bare conversion to cast const-ness away.
2008-07-16 Anatoly Sokolov <aesok@post.ru> 2008-07-16 Anatoly Sokolov <aesok@post.ru>
* config/xtensa/xtensa.h (FUNCTION_OUTGOING_VALUE, * config/xtensa/xtensa.h (FUNCTION_OUTGOING_VALUE,

View File

@ -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 /* Some platforms (e.g. OSF4) declare ldopen as taking a
non-const char * filename parameter, even though it will not non-const char * filename parameter, even though it will not
modify that string. So we must cast away const-ness here, modify that string. So we must cast away const-ness here,
which will cause -Wcast-qual to burp. */ using CONST_CAST to prevent complaints from -Wcast-qual. */
if ((ldptr = ldopen ((char *)prog_name, ldptr)) != NULL) if ((ldptr = ldopen (CONST_CAST (char *, prog_name), ldptr)) != NULL)
{ {
if (! MY_ISCOFF (HEADER (ldptr).f_magic)) if (! MY_ISCOFF (HEADER (ldptr).f_magic))
fatal ("%s: not a COFF file", prog_name); fatal ("%s: not a COFF file", prog_name);