bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: binutils fails to compile on AIX due to mismatched declaration


From: Alan Modra
Subject: Re: binutils fails to compile on AIX due to mismatched declaration
Date: Thu, 4 Mar 2021 09:01:34 +1030
User-agent: Mutt/1.9.4 (2018-02-28)

On Wed, Mar 03, 2021 at 02:48:52PM -0400, Calvin Buckley wrote:
> The declaration for a function is incorrect; the implementation of it
> is missing a const. Adding a const to the implementation (line 335) is
> enough to fix this particular issue.
> 
> rs6000-core.c:280:19: warning: type qualifiers ignored on function return 
> type [-Wignored-qualifiers]
>  const bfd_cleanup rs6000coff_core_p (bfd *abfd);
>                    ^~~~~~~~~~~~~~~~~
> rs6000-core.c:336:1: error: conflicting types for 'rs6000coff_core_p'
>  rs6000coff_core_p (bfd *abfd)
>  ^~~~~~~~~~~~~~~~~
> rs6000-core.c:280:19: note: previous declaration of 'rs6000coff_core_p' was 
> here
>  const bfd_cleanup rs6000coff_core_p (bfd *abfd);

rs6000-core.c is a file that uses AIX host headers so most people,
including me, don't compile it.  That's the excuse I'm sticking with.

Committed.

        * rs6000-core.c (rs6000coff_core_p): Correct prototype.

diff --git a/bfd/rs6000-core.c b/bfd/rs6000-core.c
index 9fed1ff48b..1c19060a5d 100644
--- a/bfd/rs6000-core.c
+++ b/bfd/rs6000-core.c
@@ -277,7 +277,7 @@ typedef union
 /* Define prototypes for certain functions, to avoid a compiler warning
    saying that they are missing.  */
 
-const bfd_cleanup rs6000coff_core_p (bfd *abfd);
+bfd_cleanup rs6000coff_core_p (bfd *abfd);
 bfd_boolean rs6000coff_core_file_matches_executable_p (bfd *core_bfd,
                                                       bfd *exec_bfd);
 char * rs6000coff_core_file_failing_command (bfd *abfd);

-- 
Alan Modra
Australia Development Lab, IBM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]