This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [rfc] asprintf() -> xasprintf()
- To: rearnsha at arm dot com
- Subject: Re: [rfc] asprintf() -> xasprintf()
- From: Fernando Nasser <fnasser at cygnus dot com>
- Date: Tue, 14 Nov 2000 11:18:46 -0500
- CC: "Frank Ch. Eigler" <fche at redhat dot com>, Andrew Cagney <ac131313 at cygnus dot com>, GDB Patches <gdb-patches at sourceware dot cygnus dot com>
- Organization: Red Hat , Inc. - Toronto
- References: <200011141607.QAA28274@cam-mail2.cambridge.arm.com>
Richard Earnshaw wrote:
>
> fche@redhat.com said:
> > Fernando Nasser <fnasser@cygnus.com> writes:
> > : Good catch. No more memory would cause an attempt to free NULL. :
> > (Have you ever considered a FREE macro that tests for NULL pointers?
> > [...]
>
> > free(NULL) is defined in even old standards to be a no-op.
>
> Then somebody had better tell sunos that: I don't think it was listening
> :-)
>
> R.
>
> free(NULL) is not defined on older machines -- it came in with ANSI.
Well, we did move GDB to ANSI, but I don't fell comfortable just assuming that
all free() implementations are already compliant.
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9