This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Commit: PR 22823: Fix gcc 8 compile time warnings
- From: Nick Clifton <nickc at redhat dot com>
- To: "Maciej W. Rozycki" <macro at mips dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 14 Feb 2018 10:02:57 +0000
- Subject: Re: Commit: PR 22823: Fix gcc 8 compile time warnings
- Authentication-results: sourceware.org; auth=none
- References: <8760716n3w.fsf@redhat.com> <alpine.DEB.2.00.1802140209380.3553@tp.orcam.me.uk>
Hi Maciej,
>> dummy functions. To solve this I chose to create a set of extra dummy
>> functions which accept a variable number of arguments. Thus
>> satisfying the compiler and allowing the build to finish.
>
> Unfortunately this has broken LD severely, in a host rather than target
> dependent manner I believe.
Yikes! Sorry about that. For some reason this problem does not show up
on my machine, even when compiling at -O0. We must be using slightly
different versions of the compiler.
Please could you try out the attached patch and let me know if it solves
the problem ?
Cheers
Nick
diff --git a/bfd/libbfd.c b/bfd/libbfd.c
index a94de20785..e195a9f0d3 100644
--- a/bfd/libbfd.c
+++ b/bfd/libbfd.c
@@ -55,7 +55,11 @@ bfd_false (bfd *ignore ATTRIBUTE_UNUSED)
bfd_boolean
bfd_false_any (bfd *ignore ATTRIBUTE_UNUSED, ...)
{
+ va_list args;
+
+ va_start (args, ignore);
bfd_set_error (bfd_error_invalid_operation);
+ va_end (args);
return FALSE;
}
@@ -91,7 +95,11 @@ bfd_nullvoidptr (bfd *ignore ATTRIBUTE_UNUSED)
void *
bfd_nullvoidptr_any (bfd *ignore ATTRIBUTE_UNUSED, ...)
{
+ va_list args;
+
+ va_start (args, ignore);
bfd_set_error (bfd_error_invalid_operation);
+ va_end (args);
return NULL;
}