public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Re: binutils fails to compile on AIX due to mismatched declaration
       [not found] <1e3b080b046957b74ee9f1e66a189b9af1b6a0cb.camel@cmpct.info>
@ 2021-03-03 22:31 ` Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2021-03-03 22:31 UTC (permalink / raw)
  To: Calvin Buckley; +Cc: bug-binutils, binutils

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-03 22:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1e3b080b046957b74ee9f1e66a189b9af1b6a0cb.camel@cmpct.info>
2021-03-03 22:31 ` binutils fails to compile on AIX due to mismatched declaration Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).