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?


Joel Brobecker <brobecker@adacore.com> writes:

>> >Breaks bootstrap on x86-apple-darwin.
>
> Humpf! Sorry about that.
>
>> gcc -m64  -g -fkeep-inline-functions -DIN_GCC   -W -Wall -Wwrite-strings 
>> -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual 
>> -Wold-style-definition -Wmissing-format-attribute -fno-common 
>> -DHAVE_CONFIG_H -I. -I. -I/Volumes/development/gcc/head/gcc/gcc 
>> -I/Volumes/development/gcc/head/gcc/gcc/. 
>> -I/Volumes/development/gcc/head/gcc/gcc/../include -I./../intl 
>> -I/Volumes/development/gcc/head/gcc/gcc/../libcpp/include 
>> -I/usr/local/x86_64/include -I/usr/local/x86_64/include 
>> -I/Volumes/development/gcc/head/gcc/gcc/../libdecnumber 
>> -I/Volumes/development/gcc/head/gcc/gcc/../libdecnumber/dpd 
>> -I../libdecnumber  \
>> 	 
>> -DLOCALEDIR=\"/Volumes/development/gcc/head/testbin-x86_64/share/locale\" \
>> 	  -c /Volumes/development/gcc/head/gcc/gcc/intl.c -o intl.o
>> In file included from /usr/include/_wctype.h:63,
>>                  from /usr/include/wchar.h:114,
>>                  from /Volumes/development/gcc/head/gcc/gcc/intl.c:85:
>> /usr/include/ctype.h:230: error: syntax error before '{' token
>> ......
>> ......
>
> Could you say why it's causing an error? I logged on an x86-darwin
> machine but it looks like the header files are slightly different
> so I can't pinpoint the code where the error occurs. If it turns
> out that this is going to be tough to work-around, then I'll back
> the change out.

You can see the problem from the above.  intl.c does a #include of
<wchar.h> after "system.h".  "system.h" includes <safe-ctype.h> (this
should probably change).  <wchar.h> includes <_wctype.h> which
includes <ctype.h>.  Thus we wind up with a #include of both
<safe-ctype.h> and <ctype.h>, which doesn't work.

Ian


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