This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Use gnulib's stdint.h.
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Bruno Haible <bruno at clisp dot org>
- Cc: Daniel Jacobowitz <drow at false dot org>, bug-gnulib at gnu dot org, gdb-patches at sourceware dot org
- Date: Mon, 30 Jun 2008 17:28:08 -0700
- Subject: Re: [RFC] Use gnulib's stdint.h.
- References: <20080605184041.GA25085@caradoc.them.org> <20080627185907.GA11664@adacore.com> <20080627191314.GA19538@caradoc.them.org> <200806280259.26427.bruno@clisp.org>
Hi Bruno,
> > > 2. ctype/safe-ctype conflict. For instance, cp-support.c includes
> > > safe-ctype.h. But at the same time, we previously included
> > > defs.h, which itself includes gnulib/stdint.h, which includes
> > > <wchar.h> which includes <ctypes.h>.
> >
> > > Problem #2 is a lot more problematic, however. I might argue that
> > > this is a actually bug inside gnulib and that gnulib/stdint.h
> > > should be generated in a way that avoids including other standard
> > > header files.
>
> No. gnulib makes no guarantee that particular headers or symbols are
> not defined.
I wasn't really suggesting that gnulib should make a general guaranty,
but if the wchar.h include could easily be avoided, then it would have
made GDB's life a little easier. It was worth asking :)
> 3. In those places where gnulib could control these extra #includes,
> the price would be sets of #ifdefs that would be too clumsy to be
> maintainable.
I see your point.
> The bug is in safe-ctype.h:
>
> #ifdef isalpha
> #error "safe-ctype.h and ctype.h may not be used simultaneously"
> #endif
>
> Actually I don't see the reason for this #error: safe-ctype.h defines only
> uppercase-named macros, and <ctype.h> defines only lowercase-named or
> underscore-prefixed macros.
I will see with the GCC maintainers what they think. Maybe the check
made better sense at one point, but no longer makes sense today.
I checked the public history of that file and version 1 of that file
(dated circa 2000) already defines the macros in uppercase and
has the isalpha macro check.
--
Joel