This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: C++-compat clean build
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: "Agovic, Sanimir" <sanimir dot agovic at intel dot com>, 'Mark Kettenis' <mark dot kettenis at xs4all dot nl>, "ooprala at redhat dot com" <ooprala at redhat dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Tue, 1 Oct 2013 18:33:59 +0200
- Subject: Re: C++-compat clean build
- Authentication-results: sourceware.org; auth=none
- References: <524AB12E dot 8090209 at redhat dot com> <201310011204 dot r91C4QVo006124 at glazunov dot sibelius dot xs4all dot nl> <0377C58828D86C4588AEEC42FC3B85A7176850E2 at IRSMSX105 dot ger dot corp dot intel dot com> <524AD936 dot 7060604 at redhat dot com>
> We have several uses of these macros already in the tree.
> They seem to have the advantage that they hide the casts and perhaps
> make the intention of the code clearer while we can't use new/new[].
> E.g., XNEW prevents errors of the type:
>
> struct foo *f = (struct foo *) xmalloc (sizeof (f));
>
> We already use these macros in gdb in several places.
> Not sure what people feel about using them more?
FWIW, I have no real strong opinion. If the casts become necessary,
and they allow us to hide them, I think they indeed would be useful.
--
Joel