This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] fix const cast in collect2.c to proceed on AIX bootstrap


Hello,

Regular bootstrap on powerpc-aix currently breaks on 

    cc1: warnings being treated as errors
    .../collect2.c: In function 'main':
    .../collect2.c:1284:7: error: new qualifiers in middle of multi-level
				  non-const cast are unsafe

issued from

   /* The AIX linker will discard static constructors in object files if
      nothing else in the file is referenced, so look at them first.  */
   {
      const char **export_object_lst = (const char **)object_lst;

The attached patch fixes this by using CONST_CAST2 as in other places.

Checked that the bootstrap proceeds past the failure point after the
change.

Thanks in advance,

Olivier

2009-06-17  Olivier Hainque  <hainque@adacore.com>

	* collect2.c (main): Use CONST_CAST2 to perform char ** to
	const char ** conversion in AIX specific section.

Attachment: collect-cast.dif
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]