This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/3 v4] Introduce common/errors.h
- From: Pedro Alves <palves at redhat dot com>
- To: Doug Evans <dje at google dot com>
- Cc: Gary Benson <gbenson at redhat dot com>, gdb-patches at sourceware dot org, Tom Tromey <tromey at redhat dot com>
- Date: Fri, 25 Jul 2014 11:14:36 +0100
- Subject: Re: [PATCH 1/3 v4] Introduce common/errors.h
- Authentication-results: sourceware.org; auth=none
- References: <1406206287-6817-1-git-send-email-gbenson at redhat dot com> <1406206287-6817-2-git-send-email-gbenson at redhat dot com> <53D1053E dot 6030902 at redhat dot com> <21457 dot 18385 dot 59886 dot 323894 at ruffy dot mtv dot corp dot google dot com>
On 07/24/2014 06:52 PM, Doug Evans wrote:
> Pedro Alves writes:
> > > + You should have received a copy of the GNU General Public License
> > > + along with this program. If not, see <http://www.gnu.org/licenses/>. */
> > > +
> > > +#include "config.h"
> >
> > Sorry for the push back, but it's wrong to only include "config.h".
> > We need to include gnulib's config.h everywhere too. I think
> > the best is to add a central common header that handles that
> > detail first.
>
> OTOH,
> just including "config.h" is a real common thing to do across all packages.
> I can imagine this coming up again and again.
>
> IWBN if hacking on gdb didn't require special cases to standard
> programming paradigms wherever possible.
> Can we arrange for config.h to include gnulib's config.h?
> Or, another thought would be to have configure generate gdb-config.h
> (or some such) and then have src/gdb/config.h include both (and similarly
> for gdbserver - haven't looked at the details though).
I fail to see how changing any of that would substantially
improve things. GDB has had defs.h for a long while, and people didn't
seem to be confused by that -- it's quite common to have a
project-specific global header to include. If we have something
like that in common, then even if we have only a single config.h,
we'd naturally include that from the common common/ header anyway
instead of in addition to including the common/ file everywhere,
also including config.h directly everywhere too.
Thanks,
Pedro Alves