This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [3/4] RFC: introduce gdb_vecs.h
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 20 Jan 2012 08:41:21 +0400
- Subject: Re: [3/4] RFC: introduce gdb_vecs.h
- References: <m3hazrxwur.fsf@fleche.redhat.com>
On Thu, Jan 19, 2012 at 01:26:20PM -0700, Tom Tromey wrote:
> I needed a VEC(char_ptr) in another header for patch #4; but this is a
> pain because it is already defined in tracepoint.h, so there can be
> clashes depending.
>
> This patch introduces gdb_vecs.h and moves the DEF_VEC_P there.
> We could add other vector definitions there as well.
>
> This is a bit of a hack, but I think it is basically the best we can do
> given how vec.h works.
>
> Another possibility here is just including vec.h from defs.h and doing
> the DEF_VEC_P there. I thought I'd pull this patch out separately in
> case anybody prefers that approach, or some other; I can implement it.
>
> Tom
>
> 2012-01-19 Tom Tromey <tromey@redhat.com>
>
> * ada-lang.c: Include gdb_vecs.h.
> * charset.c: Include gdb_vecs.h.
> * tracepoint.h: Include gdb_vecs.h.
> * gdb_vecs.h: New file.
FWIW, I tend to prefer the approach you took better. It's not a strong
preference, but if several places use the same type of vec, why not
share its declaration?
--
Joel