* RFC: remove xasprintf
@ 2012-11-28 21:30 Tom Tromey
2012-11-28 22:28 ` Pedro Alves
0 siblings, 1 reply; 6+ messages in thread
From: Tom Tromey @ 2012-11-28 21:30 UTC (permalink / raw)
To: gdb-patches
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);
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: RFC: remove xasprintf
2012-11-28 21:30 RFC: remove xasprintf Tom Tromey
@ 2012-11-28 22:28 ` Pedro Alves
2012-11-29 15:54 ` Pierre Muller
2012-11-29 16:04 ` Tom Tromey
0 siblings, 2 replies; 6+ messages in thread
From: Pedro Alves @ 2012-11-28 22:28 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
On 11/28/2012 09:29 PM, Tom Tromey wrote:
> 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.
Zap it!
I believe we may need to tweak the ari too.
--
Pedro Alves
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: RFC: remove xasprintf
2012-11-28 22:28 ` Pedro Alves
@ 2012-11-29 15:54 ` Pierre Muller
2012-11-29 16:04 ` Tom Tromey
1 sibling, 0 replies; 6+ messages in thread
From: Pierre Muller @ 2012-11-29 15:54 UTC (permalink / raw)
To: 'Pedro Alves', 'Tom Tromey'; +Cc: gdb-patches
> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Pedro Alves
> Envoyé : mercredi 28 novembre 2012 23:28
> À : Tom Tromey
> Cc : gdb-patches@sourceware.org
> Objet : Re: RFC: remove xasprintf
>
> On 11/28/2012 09:29 PM, Tom Tromey wrote:
> > 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.
>
> Zap it!
>
> I believe we may need to tweak the ari too.
I can take care of this once it is in.
Pierre Muller
as ARI maintainer.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: RFC: remove xasprintf
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>
1 sibling, 2 replies; 6+ messages in thread
From: Tom Tromey @ 2012-11-29 16:04 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
Pedro> I believe we may need to tweak the ari too.
Here's an update.
This requires an approval from Pierre.
Tom
2012-11-29 Tom Tromey <tromey@redhat.com>
* contrib/ari/gdb_ari.sh: Remove rules for xasprintf and
xvasprintf.
* 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);
diff --git a/gdb/contrib/ari/gdb_ari.sh b/gdb/contrib/ari/gdb_ari.sh
index 123249e..2211f66 100644
--- a/gdb/contrib/ari/gdb_ari.sh
+++ b/gdb/contrib/ari/gdb_ari.sh
@@ -1127,26 +1127,6 @@ Do not use vasprintf(), instead use xstrvprintf"
fail("vasprintf")
}
-BEGIN { doc["xasprintf"] = "\
-Do not use xasprintf(), instead use xstrprintf"
- fix("xasprintf", "common/common-utils.h", 1)
- fix("xasprintf", "common/common-utils.c", 1)
- category["xasprintf"] = ari_regression
-}
-/(^|[^_[:alnum:]])xasprintf[[:space:]]*\(/ {
- fail("xasprintf")
-}
-
-BEGIN { doc["xvasprintf"] = "\
-Do not use xvasprintf(), instead use xstrvprintf"
- fix("xvasprintf", "common/common-utils.h", 1)
- fix("xvasprintf", "common/common-utils.c", 1)
- category["xvasprintf"] = ari_regression
-}
-/(^|[^_[:alnum:]])xvasprintf[[:space:]]*\(/ {
- fail("xvasprintf")
-}
-
# More generic memory operations
BEGIN { doc["bzero"] = "\
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: RFC: remove xasprintf
2012-11-29 16:04 ` Tom Tromey
@ 2012-11-29 16:43 ` Pierre Muller
[not found] ` <34762.3197515079$1354207434@news.gmane.org>
1 sibling, 0 replies; 6+ messages in thread
From: Pierre Muller @ 2012-11-29 16:43 UTC (permalink / raw)
To: 'Tom Tromey', 'Pedro Alves'; +Cc: gdb-patches
> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Tom Tromey
> Envoyé : jeudi 29 novembre 2012 16:41
> À : Pedro Alves
> Cc : gdb-patches@sourceware.org
> Objet : Re: RFC: remove xasprintf
>
> >>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
>
> Pedro> I believe we may need to tweak the ari too.
>
> Here's an update.
>
> This requires an approval from Pierre.
I am more than glad to give it!
Thanks
Pierre
> Tom
>
> 2012-11-29 Tom Tromey <tromey@redhat.com>
>
> * contrib/ari/gdb_ari.sh: Remove rules for xasprintf and
> xvasprintf.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: RFC: remove xasprintf
[not found] ` <34762.3197515079$1354207434@news.gmane.org>
@ 2012-11-29 17:20 ` Tom Tromey
0 siblings, 0 replies; 6+ messages in thread
From: Tom Tromey @ 2012-11-29 17:20 UTC (permalink / raw)
To: Pierre Muller; +Cc: 'Pedro Alves', gdb-patches
>>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr> writes:
Tom> This requires an approval from Pierre.
Pierre> I am more than glad to give it!
Thanks. I'm checking the patch in.
Tom
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-11-29 17:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-28 21:30 RFC: remove xasprintf Tom Tromey
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox