summaryrefslogtreecommitdiff
path: root/libiberty/vasprintf.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2005-03-28 02:09:01 +0000
committerDJ Delorie <dj@redhat.com>2005-03-28 02:09:01 +0000
commit49b1fae4309ab5b9833f0af388483c2b6b4b3d50 (patch)
tree4d135fc6ff13dd077dc5cf1669777e75cae85305 /libiberty/vasprintf.c
parent67700458404b636f413570c6fab3d2cb221c63ba (diff)
downloadbinutils-gdb-49b1fae4309ab5b9833f0af388483c2b6b4b3d50.tar.gz
merge from gcc
Diffstat (limited to 'libiberty/vasprintf.c')
-rw-r--r--libiberty/vasprintf.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/libiberty/vasprintf.c b/libiberty/vasprintf.c
index 7eaf2b18d6f..ff4b5315199 100644
--- a/libiberty/vasprintf.c
+++ b/libiberty/vasprintf.c
@@ -22,11 +22,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#endif
#include <ansidecl.h>
-#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#if !defined (va_copy) && defined (__va_copy)
# define va_copy(d,s) __va_copy((d),(s))
#endif
@@ -62,13 +58,10 @@ not be allocated, minus one is returned and @code{NULL} is stored in
*/
-static int int_vasprintf PARAMS ((char **, const char *, va_list));
+static int int_vasprintf (char **, const char *, va_list);
static int
-int_vasprintf (result, format, args)
- char **result;
- const char *format;
- va_list args;
+int_vasprintf (char **result, const char *format, va_list args)
{
const char *p = format;
/* Add one to make sure that it is never zero, which might cause malloc
@@ -156,13 +149,11 @@ int_vasprintf (result, format, args)
}
int
-vasprintf (result, format, args)
- char **result;
- const char *format;
+vasprintf (char **result, const char *format,
#if defined (_BSD_VA_LIST_) && defined (__FreeBSD__)
- _BSD_VA_LIST_ args;
+ _BSD_VA_LIST_ args)
#else
- va_list args;
+ va_list args)
#endif
{
return int_vasprintf (result, format, args);
@@ -170,7 +161,7 @@ vasprintf (result, format, args)
#ifdef TEST
static void ATTRIBUTE_PRINTF_1
-checkit VPARAMS ((const char *format, ...))
+checkit (const char *format, ...)
{
char *result;
VA_OPEN (args, format);
@@ -187,10 +178,10 @@ checkit VPARAMS ((const char *format, ...))
free (result);
}
-extern int main PARAMS ((void));
+extern int main (void);
int
-main ()
+main (void)
{
checkit ("%d", 0x12345678);
checkit ("%200d", 5);