aboutsummaryrefslogtreecommitdiff
path: root/include/libiberty.h
diff options
context:
space:
mode:
authorRichard Earnshaw <Richard.Earnshaw@arm.com>2015-01-07 17:32:24 +0000
committerRichard Earnshaw <Richard.Earnshaw@arm.com>2015-01-07 17:34:29 +0000
commit7c89917ffa6813f40fbb9f345411d59716e90714 (patch)
tree6457a90f308cea40a799e74f72c9b3a122f0b17c /include/libiberty.h
parentd7b24d2941fd7c99ba5843331989e6023075f0d0 (diff)
downloadgdb-7c89917ffa6813f40fbb9f345411d59716e90714.zip
gdb-7c89917ffa6813f40fbb9f345411d59716e90714.tar.gz
gdb-7c89917ffa6813f40fbb9f345411d59716e90714.tar.bz2
Sync with gcc/libiberty.
Diffstat (limited to 'include/libiberty.h')
-rw-r--r--include/libiberty.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/libiberty.h b/include/libiberty.h
index 9ef1b11..eec8009 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -623,6 +623,11 @@ extern int pwait (int, int *, int);
extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
#endif
+/* Like asprintf but allocates memory without fail. This works like
+ xmalloc. */
+
+extern char *xasprintf (const char *, ...) ATTRIBUTE_MALLOC ATTRIBUTE_PRINTF_1;
+
#if !HAVE_DECL_VASPRINTF
/* Like vsprintf but provides a pointer to malloc'd storage, which
must be freed by the caller. */
@@ -630,6 +635,11 @@ extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
extern int vasprintf (char **, const char *, va_list) ATTRIBUTE_PRINTF(2,0);
#endif
+/* Like vasprintf but allocates memory without fail. This works like
+ xmalloc. */
+
+extern char *xvasprintf (const char *, va_list) ATTRIBUTE_MALLOC ATTRIBUTE_PRINTF(1,0);
+
#if defined(HAVE_DECL_SNPRINTF) && !HAVE_DECL_SNPRINTF
/* Like sprintf but prints at most N characters. */
extern int snprintf (char *, size_t, const char *, ...) ATTRIBUTE_PRINTF_3;