From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Subject: RFC: remove xasprintf
Date: Wed, 28 Nov 2012 21:30:00 -0000 [thread overview]
Message-ID: <87r4nd8lgo.fsf@fleche.redhat.com> (raw)
This patch removes xasprintf and xvasprintf.
I believe we had agreed not to use them any more, and I don't see any
uses in the tree any more.
Tested by rebuilding and grep.
Tom
2012-11-28 Tom Tromey <tromey@redhat.com>
* common/common-utils.c (xasprintf, xvasprintf): Remove.
* common/common-utils.h (xasprintf, xvasprintf): Remove.
diff --git a/gdb/common/common-utils.c b/gdb/common/common-utils.c
index ad01ed6..ef5d638 100644
--- a/gdb/common/common-utils.c
+++ b/gdb/common/common-utils.c
@@ -137,22 +137,6 @@ xstrvprintf (const char *format, va_list ap)
return ret;
}
-void
-xasprintf (char **ret, const char *format, ...)
-{
- va_list args;
-
- va_start (args, format);
- (*ret) = xstrvprintf (format, args);
- va_end (args);
-}
-
-void
-xvasprintf (char **ret, const char *format, va_list ap)
-{
- (*ret) = xstrvprintf (format, ap);
-}
-
int
xsnprintf (char *str, size_t size, const char *format, ...)
{
diff --git a/gdb/common/common-utils.h b/gdb/common/common-utils.h
index 030bcc5..58fa3f9 100644
--- a/gdb/common/common-utils.h
+++ b/gdb/common/common-utils.h
@@ -43,13 +43,6 @@ char *xstrprintf (const char *format, ...) ATTRIBUTE_PRINTF (1, 2);
char *xstrvprintf (const char *format, va_list ap)
ATTRIBUTE_PRINTF (1, 0);
-/* Like asprintf/vasprintf but get an internal_error if the call
- fails. */
-void xasprintf (char **ret, const char *format, ...)
- ATTRIBUTE_PRINTF (2, 3);
-void xvasprintf (char **ret, const char *format, va_list ap)
- ATTRIBUTE_PRINTF (2, 0);
-
/* Like snprintf, but throw an error if the output buffer is too small. */
int xsnprintf (char *str, size_t size, const char *format, ...)
ATTRIBUTE_PRINTF (3, 4);
next reply other threads:[~2012-11-28 21:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-28 21:30 Tom Tromey [this message]
2012-11-28 22:28 ` Pedro Alves
2012-11-29 15:54 ` Pierre Muller
2012-11-29 16:04 ` Tom Tromey
2012-11-29 16:43 ` Pierre Muller
[not found] ` <34762.3197515079$1354207434@news.gmane.org>
2012-11-29 17:20 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r4nd8lgo.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox