aboutsummaryrefslogtreecommitdiff
path: root/bfd/bfd.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-09-26 01:53:25 +0000
committerAlan Modra <amodra@gmail.com>2001-09-26 01:53:25 +0000
commitaf6166c063c3fabe3ff4ebad48e9a4031e2f7a2a (patch)
treea786aebeccb44d687329ddcfd13021d9ac7ea9bc /bfd/bfd.c
parentca990479da9e62a5aea068de80e4af163b8c801f (diff)
downloadfsf-binutils-gdb-af6166c063c3fabe3ff4ebad48e9a4031e2f7a2a.zip
fsf-binutils-gdb-af6166c063c3fabe3ff4ebad48e9a4031e2f7a2a.tar.gz
fsf-binutils-gdb-af6166c063c3fabe3ff4ebad48e9a4031e2f7a2a.tar.bz2
* bfd.c (_bfd_default_error_handlerl): Define using VPARAMS,
VA_OPEN, VA_FIXEDARG, VA_CLOSE. (bfd_archive_filename): Cast bfd_malloc arg to the correct size.
Diffstat (limited to 'bfd/bfd.c')
-rw-r--r--bfd/bfd.c43
1 files changed, 5 insertions, 38 deletions
diff --git a/bfd/bfd.c b/bfd/bfd.c
index 8ffc7c3..0dd4289 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -410,57 +410,24 @@ static const char *_bfd_error_program_name;
/* This is the default routine to handle BFD error messages. */
-#ifdef ANSI_PROTOTYPES
-
static void _bfd_default_error_handler PARAMS ((const char *s, ...));
static void
-_bfd_default_error_handler (const char *s, ...)
+_bfd_default_error_handler VPARAMS ((const char *s, ...))
{
- va_list p;
-
if (_bfd_error_program_name != NULL)
fprintf (stderr, "%s: ", _bfd_error_program_name);
else
fprintf (stderr, "BFD: ");
- va_start (p, s);
-
+ VA_OPEN (p, s);
+ VA_FIXEDARG (p, const char *, s);
vfprintf (stderr, s, p);
-
- va_end (p);
+ VA_CLOSE (p);
fprintf (stderr, "\n");
}
-#else /* ! defined (ANSI_PROTOTYPES) */
-
-static void _bfd_default_error_handler ();
-
-static void
-_bfd_default_error_handler (va_alist)
- va_dcl
-{
- va_list p;
- const char *s;
-
- if (_bfd_error_program_name != NULL)
- fprintf (stderr, "%s: ", _bfd_error_program_name);
- else
- fprintf (stderr, "BFD: ");
-
- va_start (p);
-
- s = va_arg (p, const char *);
- vfprintf (stderr, s, p);
-
- va_end (p);
-
- fprintf (stderr, "\n");
-}
-
-#endif /* ! defined (ANSI_PROTOTYPES) */
-
/* This is a function pointer to the routine which should handle BFD
error messages. It is called when a BFD routine encounters an
error for which it wants to print a message. Going through a
@@ -560,7 +527,7 @@ bfd_archive_filename (abfd)
if (curr)
free (buf);
curr = needed + (needed >> 1);
- buf = bfd_malloc (curr);
+ buf = bfd_malloc ((bfd_size_type) curr);
/* If we can't malloc, fail safe by returning just the file
name. This function is only used when building error
messages. */