This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFAv3 2/2] Factorize macro definition code in macrotab.c
- From: Philippe Waroquiers <philippe dot waroquiers at skynet dot be>
- To: Simon Marchi <simon dot marchi at polymtl dot ca>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 06 Feb 2019 21:08:05 +0100
- Subject: Re: [RFAv3 2/2] Factorize macro definition code in macrotab.c
- References: <20190126223117.6718-1-philippe.waroquiers@skynet.be> <20190126223117.6718-3-philippe.waroquiers@skynet.be> <d5206fd0749af653b7a5cca0b49cfe79@polymtl.ca>
On Tue, 2019-02-05 at 23:12 -0500, Simon Marchi wrote:
> On 2019-01-26 17:31, Philippe Waroquiers wrote:
> > When first fixing splay tree key leaks in macrotab.c, some duplicated
> > code
> > logic was factorized.
> > The key leaks will be fixed in libiberty, but the code factorization
> > is better kept in any case.
>
> LGTM, with just a nit:
>
> > +/* A helper function to define a new object-like macro. */
> > +
> > +static void
> > +macro_define_object_internal (struct macro_source_file *source, int
> > line,
> > + const char *name, const char *replacement,
> > + enum macro_special_kind special_kind)
> > +{
> > + macro_define_internal (source, line,
> > + name, macro_object_like,
> > + special_kind, 0,
> > + replacement);
> > +}
>
> Since it is a pointer parameter, could you change the "0" for "NULL" or
> "nullptr"?
Thanks for the review, I pushed the series after doing the fixes
in this and in the other mail.
Philippe