From b38ead219b31fed4014cd5b1078da968744b879d Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sun, 11 Jan 2015 08:30:33 +1030 Subject: [PATCH] Assorted compiler warning fixes The C standard doesn't guarantee a function pointer can be cast to void* and vice versa. binutils/ * prdbg.c (print_debugging_info): Don't use void* for function pointer param. * budbg.h (print_debugging_info): Update prototype. gas/ * read.c (s_altmacro, s_reloc): Make definition static. --- binutils/ChangeLog | 6 ++++++ binutils/budbg.h | 3 ++- binutils/prdbg.c | 5 +++-- gas/ChangeLog | 4 ++++ gas/read.c | 4 ++-- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index e6fa3c11e57..9458a84211f 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2015-01-12 Alan Modra + + * prdbg.c (print_debugging_info): Don't use void* for function + pointer param. + * budbg.h (print_debugging_info): Update prototype. + 2015-01-08 Nick Clifton PR binutils/17512 diff --git a/binutils/budbg.h b/binutils/budbg.h index fc1ee2b57f1..18c022deb62 100644 --- a/binutils/budbg.h +++ b/binutils/budbg.h @@ -29,7 +29,8 @@ extern void *read_debugging_info (bfd *, asymbol **, long, bfd_boolean); /* Routine used to print generic debugging information. */ extern bfd_boolean print_debugging_info - (FILE *, void *, bfd *, asymbol **, void *, bfd_boolean); + (FILE *, void *, bfd *, asymbol **, + char * (*) (struct bfd *, const char *, int), bfd_boolean); /* Routines used to read and write stabs information. */ diff --git a/binutils/prdbg.c b/binutils/prdbg.c index 4ef481cddef..6e2b2172e48 100644 --- a/binutils/prdbg.c +++ b/binutils/prdbg.c @@ -291,7 +291,8 @@ static const struct debug_write_fns tg_fns = bfd_boolean print_debugging_info (FILE *f, void *dhandle, bfd *abfd, asymbol **syms, - void *demangler, bfd_boolean as_tags) + char * (*demangler) (struct bfd *, const char *, int), + bfd_boolean as_tags) { struct pr_handle info; @@ -302,7 +303,7 @@ print_debugging_info (FILE *f, void *dhandle, bfd *abfd, asymbol **syms, info.filename = NULL; info.abfd = abfd; info.syms = syms; - info.demangler = (char * (*)(struct bfd *, const char *, int)) demangler; + info.demangler = demangler; if (as_tags) { diff --git a/gas/ChangeLog b/gas/ChangeLog index 97422c1b54b..a0deb6abc67 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,7 @@ +2015-01-12 Alan Modra + + * read.c (s_altmacro, s_reloc): Make definition static. + 2015-01-10 Andrew Burgess * config/tc-avr.c (md_apply_fix): Update the contents of VALP for diff --git a/gas/read.c b/gas/read.c index 585d7efb894..7dfc20a7371 100644 --- a/gas/read.c +++ b/gas/read.c @@ -1579,7 +1579,7 @@ s_align_ptwo (int arg) /* Switch in and out of alternate macro mode. */ -void +static void s_altmacro (int on) { demand_empty_rest_of_line (); @@ -3984,7 +3984,7 @@ s_rva (int size) /* .reloc offset, reloc_name, symbol+addend. */ -void +static void s_reloc (int ignore ATTRIBUTE_UNUSED) { char *stop = NULL; -- 2.30.2