This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Use gnulib's stdint.h.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]