This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [RFA/RFC] Remove check of ctype.h include in safe-ctype.h?


You guys broken darwin bootstrap
:(

In file included from /usr/include/_wctype.h:63,
                 from /usr/include/wchar.h:114,
                 from ../../gcc/intl.c:85:
/usr/include/ctype.h:230: error: syntax error before '{' token
/usr/include/ctype.h:236: error: syntax error before '{' token
/usr/include/ctype.h:248: error: syntax error before '{' token
/usr/include/ctype.h:255: error: syntax error before '{' token
/usr/include/ctype.h:261: error: syntax error before '{' token
/usr/include/ctype.h:267: error: syntax error before '{' token
/usr/include/ctype.h:273: error: syntax error before '{' token
/usr/include/ctype.h:279: error: syntax error before '{' token
/usr/include/ctype.h:285: error: syntax error before '{' token
/usr/include/ctype.h:291: error: syntax error before '{' token
/usr/include/ctype.h:298: error: syntax error before '{' token
/usr/include/ctype.h:310: error: syntax error before '{' token
/usr/include/ctype.h:316: error: syntax error before '{' token


On Sat, Jul 5, 2008 at 5:01 PM, Kaveh R. Ghazi <ghazi@caip.rutgers.edu> wrote:
> From: "Joel Brobecker" <brobecker@adacore.com>
>
>>> Would it work to instead #poison isalpha et al in gcc/system.h?  Then
>>> remove the check from safe-ctype.h altogether.
>>
>> I think it would work.  But why putting these pragmas outside of
>> safe-ctype.h? How about putting them at the end of safe-ctype.h
>> instead?
>
> If you put the #poison statement in safe-ctype.h, then if you include
> ctype.h after safe-ctype.h you'll get an error when ctype.h defines all its
> macros, right?  I think this kinds of situation is what started the whole
> thread.  I'm not sure even putting the #poison in system.h is safe, because
> some header files may include ctype.h again, like the wchar.h problem you
> originally reported.
>
> I think the only thing that would be truly safe would be to include ctype.h
> in system.h *before* safe-ctype.h.  Only then after including both files
> would you #poison the isfoo macros.  At that point if any file tries to
> reinclude ctype.h, the macro guards around that header should prevent the
> file from being reparsed and then no #poison would trigger.  Whew!
>
> Thoughts?
> --Kaveh
>
>


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