From 2ca7de3746be7484aa5affceafa1ad2e1d789381 Mon Sep 17 00:00:00 2001 From: Pedro Alves <palves@redhat.com> Date: Wed, 4 Oct 2017 14:20:51 +0100 Subject: bfd_set_input_error A downside to the 2017-10-04 PR22245 fix is that bfd_set_error can now silently accept invalid errors if/when someone passes the a value of the wrong enumeration type, which previously would be caught by the -Wenum-conversion warning. PR 22245 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove ellipsis parameter. Split out bfd_error_on_input code to.. (bfd_set_input_error): .. New function. * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error. * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise. * bfd-in2.h: Regenerate. --- bfd/bfd-in2.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bfd/bfd-in2.h') diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 62be566..4ba05b1 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -7054,7 +7054,9 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (int error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); -- cgit v1.1