public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Unable to use bool type in i386.h
@ 2013-11-22 12:54 Terry Guo
  2013-11-22 13:59 ` Rob
  0 siblings, 1 reply; 10+ messages in thread
From: Terry Guo @ 2013-11-22 12:54 UTC (permalink / raw)
  To: gcc

Hi there,

I am using latest trunk code and declared a bool type variable in
i386.h as below:

extern bool mybool;

And then configure gcc as:

../gcc/configure --enable-languages=c,c++ --disable-bootstrap

During the stage of libgcc build, I then ran into following errors:

make[3]: Leaving directory
`/myssd/terguo01/toolchain-build/flash-prefetch/src/gcc-build/i686-pc-linux-gnu/libgcc'
/myssd/terguo01/toolchain-build/flash-prefetch/src/gcc-build/./gcc/xgcc
-B/myssd/terguo01/toolchain-build/flash-prefetch/src/gcc-build/./gcc/
-B/usr/local/i686-pc-linux-gnu/bin/
-B/usr/local/i686-pc-linux-gnu/lib/ -isystem
/usr/local/i686-pc-linux-gnu/include -isystem
/usr/local/i686-pc-linux-gnu/sys-include    -g -O2 -O2  -g -O2
-DIN_GCC    -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition  -isystem ./include
-fpic -mlong-double-80 -g -DIN_LIBGCC2 -fbuilding-libgcc
-fno-stack-protector   -fpic -mlong-double-80 -I. -I. -I../.././gcc
-I../../../gcc/libgcc -I../../../gcc/libgcc/.
-I../../../gcc/libgcc/../gcc -I../../../gcc/libgcc/../include
-I../../../gcc/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT
-DHAVE_CC_TLS  -DUSE_TLS -o _clear_cache.o -MT _clear_cache.o -MD -MP
-MF _clear_cache.dep -DL_clear_cache -c ../../../gcc/libgcc/libgcc2.c
-fvisibility=hidden -DHIDE_EXPORTS
In file included from ../.././gcc/tm.h:22:0,
                 from ../../../gcc/libgcc/libgcc2.c:29:
../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
type name ‘bool’
 extern bool mybool;
 ^
In file included from ../.././gcc/tm.h:22:0,
                 from ../../../gcc/libgcc/libgcc2.c:29:
../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
type name ‘bool’
 extern bool mybool;
 ^
In file included from ../.././gcc/tm.h:22:0,
                 from ../../../gcc/libgcc/libgcc2.c:29:
../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
type name ‘bool’
 extern bool mybool;
 ^
In file included from ../.././gcc/tm.h:22:0,
                 from ../../../gcc/libgcc/libgcc2.c:29:
../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
type name ‘bool’
 extern bool mybool;
 ^
In file included from ../.././gcc/tm.h:22:0,
                 from ../../../gcc/libgcc/libgcc2.c:29:
../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
type name ‘bool’
 extern bool mybool;
 ^
In file included from ../.././gcc/tm.h:22:0,
                 from ../../../gcc/libgcc/libgcc2.c:29:
../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
type name ‘bool’
 extern bool mybool;
 ^
make[2]: *** [_muldi3.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [_negdi2.o] Error 1
make[2]: *** [_ashldi3.o] Error 1
make[2]: *** [_cmpdi2.o] Error 1
make[2]: *** [_lshrdi3.o] Error 1
make[2]: *** [_ashrdi3.o] Error 1
In file included from ../.././gcc/tm.h:22:0,
                 from ../../../gcc/libgcc/libgcc2.c:29:
../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
type name ‘bool’
 extern bool mybool;
 ^
In file included from ../.././gcc/tm.h:22:0,
                 from ../../../gcc/libgcc/libgcc2.c:29:
../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
type name ‘bool’
 extern bool mybool;
 ^
make[2]: *** [_clear_cache.o] Error 1
make[2]: *** [_ucmpdi2.o] Error 1
make[2]: Leaving directory
`/myssd/terguo01/toolchain-build/flash-prefetch/src/gcc-build/i686-pc-linux-gnu/libgcc'
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory
`/myssd/terguo01/toolchain-build/flash-prefetch/src/gcc-build'
make: *** [all] Error 2

What should I do to use bool type in i386.h? Please help. Thanks in advance.

BR,
Terry

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Unable to use bool type in i386.h
  2013-11-22 12:54 Unable to use bool type in i386.h Terry Guo
@ 2013-11-22 13:59 ` Rob
  2013-11-22 14:09   ` Terry Guo
  0 siblings, 1 reply; 10+ messages in thread
From: Rob @ 2013-11-22 13:59 UTC (permalink / raw)
  To: Terry Guo; +Cc: gcc

It seems that C files include this, so you'll want _Bool, or just use an int.

BR,
Rob

On 22 November 2013 11:51, Terry Guo <flameroc@gmail.com> wrote:
> Hi there,
>
> I am using latest trunk code and declared a bool type variable in
> i386.h as below:
>
> extern bool mybool;
>
> And then configure gcc as:
>
> ../gcc/configure --enable-languages=c,c++ --disable-bootstrap
>
> During the stage of libgcc build, I then ran into following errors:
>
> make[3]: Leaving directory
> `/myssd/terguo01/toolchain-build/flash-prefetch/src/gcc-build/i686-pc-linux-gnu/libgcc'
> /myssd/terguo01/toolchain-build/flash-prefetch/src/gcc-build/./gcc/xgcc
> -B/myssd/terguo01/toolchain-build/flash-prefetch/src/gcc-build/./gcc/
> -B/usr/local/i686-pc-linux-gnu/bin/
> -B/usr/local/i686-pc-linux-gnu/lib/ -isystem
> /usr/local/i686-pc-linux-gnu/include -isystem
> /usr/local/i686-pc-linux-gnu/sys-include    -g -O2 -O2  -g -O2
> -DIN_GCC    -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes
> -Wmissing-prototypes -Wold-style-definition  -isystem ./include
> -fpic -mlong-double-80 -g -DIN_LIBGCC2 -fbuilding-libgcc
> -fno-stack-protector   -fpic -mlong-double-80 -I. -I. -I../.././gcc
> -I../../../gcc/libgcc -I../../../gcc/libgcc/.
> -I../../../gcc/libgcc/../gcc -I../../../gcc/libgcc/../include
> -I../../../gcc/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT
> -DHAVE_CC_TLS  -DUSE_TLS -o _clear_cache.o -MT _clear_cache.o -MD -MP
> -MF _clear_cache.dep -DL_clear_cache -c ../../../gcc/libgcc/libgcc2.c
> -fvisibility=hidden -DHIDE_EXPORTS
> In file included from ../.././gcc/tm.h:22:0,
>                  from ../../../gcc/libgcc/libgcc2.c:29:
> ../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
> type name ‘bool’
>  extern bool mybool;
>  ^
> In file included from ../.././gcc/tm.h:22:0,
>                  from ../../../gcc/libgcc/libgcc2.c:29:
> ../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
> type name ‘bool’
>  extern bool mybool;
>  ^
> In file included from ../.././gcc/tm.h:22:0,
>                  from ../../../gcc/libgcc/libgcc2.c:29:
> ../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
> type name ‘bool’
>  extern bool mybool;
>  ^
> In file included from ../.././gcc/tm.h:22:0,
>                  from ../../../gcc/libgcc/libgcc2.c:29:
> ../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
> type name ‘bool’
>  extern bool mybool;
>  ^
> In file included from ../.././gcc/tm.h:22:0,
>                  from ../../../gcc/libgcc/libgcc2.c:29:
> ../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
> type name ‘bool’
>  extern bool mybool;
>  ^
> In file included from ../.././gcc/tm.h:22:0,
>                  from ../../../gcc/libgcc/libgcc2.c:29:
> ../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
> type name ‘bool’
>  extern bool mybool;
>  ^
> make[2]: *** [_muldi3.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
> make[2]: *** [_negdi2.o] Error 1
> make[2]: *** [_ashldi3.o] Error 1
> make[2]: *** [_cmpdi2.o] Error 1
> make[2]: *** [_lshrdi3.o] Error 1
> make[2]: *** [_ashrdi3.o] Error 1
> In file included from ../.././gcc/tm.h:22:0,
>                  from ../../../gcc/libgcc/libgcc2.c:29:
> ../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
> type name ‘bool’
>  extern bool mybool;
>  ^
> In file included from ../.././gcc/tm.h:22:0,
>                  from ../../../gcc/libgcc/libgcc2.c:29:
> ../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
> type name ‘bool’
>  extern bool mybool;
>  ^
> make[2]: *** [_clear_cache.o] Error 1
> make[2]: *** [_ucmpdi2.o] Error 1
> make[2]: Leaving directory
> `/myssd/terguo01/toolchain-build/flash-prefetch/src/gcc-build/i686-pc-linux-gnu/libgcc'
> make[1]: *** [all-target-libgcc] Error 2
> make[1]: Leaving directory
> `/myssd/terguo01/toolchain-build/flash-prefetch/src/gcc-build'
> make: *** [all] Error 2
>
> What should I do to use bool type in i386.h? Please help. Thanks in advance.
>
> BR,
> Terry

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Unable to use bool type in i386.h
  2013-11-22 13:59 ` Rob
@ 2013-11-22 14:09   ` Terry Guo
       [not found]     ` <CABJqhQOf-uMVq71_dVQ1pxZyX0Pd9yYW3PdYNHP5vk3hYFJPUw@mail.gmail.com>
  0 siblings, 1 reply; 10+ messages in thread
From: Terry Guo @ 2013-11-22 14:09 UTC (permalink / raw)
  To: Rob; +Cc: gcc

On Fri, Nov 22, 2013 at 8:53 PM, Rob <robpilling@gmail.com> wrote:
> It seems that C files include this, so you'll want _Bool, or just use an int.
>
> BR,
> Rob
>

Thanks for your reply. I know I can use the int. But the bool type is
more precise. And now GCC is in C++, the bool type should be
supported. I am curious whether this is a missing part of GCC. Can
someone please help to confirm?

BR,
Terry

> On 22 November 2013 11:51, Terry Guo <flameroc@gmail.com> wrote:
>> Hi there,
>>
>> I am using latest trunk code and declared a bool type variable in
>> i386.h as below:
>>
>> extern bool mybool;
>>
>> And then configure gcc as:
>>
>> ../gcc/configure --enable-languages=c,c++ --disable-bootstrap
>>
>> During the stage of libgcc build, I then ran into following errors:
>>
>> make[3]: Leaving directory
>> `/myssd/terguo01/toolchain-build/flash-prefetch/src/gcc-build/i686-pc-linux-gnu/libgcc'
>> /myssd/terguo01/toolchain-build/flash-prefetch/src/gcc-build/./gcc/xgcc
>> -B/myssd/terguo01/toolchain-build/flash-prefetch/src/gcc-build/./gcc/
>> -B/usr/local/i686-pc-linux-gnu/bin/
>> -B/usr/local/i686-pc-linux-gnu/lib/ -isystem
>> /usr/local/i686-pc-linux-gnu/include -isystem
>> /usr/local/i686-pc-linux-gnu/sys-include    -g -O2 -O2  -g -O2
>> -DIN_GCC    -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes
>> -Wmissing-prototypes -Wold-style-definition  -isystem ./include
>> -fpic -mlong-double-80 -g -DIN_LIBGCC2 -fbuilding-libgcc
>> -fno-stack-protector   -fpic -mlong-double-80 -I. -I. -I../.././gcc
>> -I../../../gcc/libgcc -I../../../gcc/libgcc/.
>> -I../../../gcc/libgcc/../gcc -I../../../gcc/libgcc/../include
>> -I../../../gcc/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT
>> -DHAVE_CC_TLS  -DUSE_TLS -o _clear_cache.o -MT _clear_cache.o -MD -MP
>> -MF _clear_cache.dep -DL_clear_cache -c ../../../gcc/libgcc/libgcc2.c
>> -fvisibility=hidden -DHIDE_EXPORTS
>> In file included from ../.././gcc/tm.h:22:0,
>>                  from ../../../gcc/libgcc/libgcc2.c:29:
>> ../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
>> type name ‘bool’
>>  extern bool mybool;
>>  ^
>> In file included from ../.././gcc/tm.h:22:0,
>>                  from ../../../gcc/libgcc/libgcc2.c:29:
>> ../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
>> type name ‘bool’
>>  extern bool mybool;
>>  ^
>> In file included from ../.././gcc/tm.h:22:0,
>>                  from ../../../gcc/libgcc/libgcc2.c:29:
>> ../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
>> type name ‘bool’
>>  extern bool mybool;
>>  ^
>> In file included from ../.././gcc/tm.h:22:0,
>>                  from ../../../gcc/libgcc/libgcc2.c:29:
>> ../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
>> type name ‘bool’
>>  extern bool mybool;
>>  ^
>> In file included from ../.././gcc/tm.h:22:0,
>>                  from ../../../gcc/libgcc/libgcc2.c:29:
>> ../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
>> type name ‘bool’
>>  extern bool mybool;
>>  ^
>> In file included from ../.././gcc/tm.h:22:0,
>>                  from ../../../gcc/libgcc/libgcc2.c:29:
>> ../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
>> type name ‘bool’
>>  extern bool mybool;
>>  ^
>> make[2]: *** [_muldi3.o] Error 1
>> make[2]: *** Waiting for unfinished jobs....
>> make[2]: *** [_negdi2.o] Error 1
>> make[2]: *** [_ashldi3.o] Error 1
>> make[2]: *** [_cmpdi2.o] Error 1
>> make[2]: *** [_lshrdi3.o] Error 1
>> make[2]: *** [_ashrdi3.o] Error 1
>> In file included from ../.././gcc/tm.h:22:0,
>>                  from ../../../gcc/libgcc/libgcc2.c:29:
>> ../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
>> type name ‘bool’
>>  extern bool mybool;
>>  ^
>> In file included from ../.././gcc/tm.h:22:0,
>>                  from ../../../gcc/libgcc/libgcc2.c:29:
>> ../../../gcc/libgcc/../gcc/config/i386/i386.h:2099:1: error: unknown
>> type name ‘bool’
>>  extern bool mybool;
>>  ^
>> make[2]: *** [_clear_cache.o] Error 1
>> make[2]: *** [_ucmpdi2.o] Error 1
>> make[2]: Leaving directory
>> `/myssd/terguo01/toolchain-build/flash-prefetch/src/gcc-build/i686-pc-linux-gnu/libgcc'
>> make[1]: *** [all-target-libgcc] Error 2
>> make[1]: Leaving directory
>> `/myssd/terguo01/toolchain-build/flash-prefetch/src/gcc-build'
>> make: *** [all] Error 2
>>
>> What should I do to use bool type in i386.h? Please help. Thanks in advance.
>>
>> BR,
>> Terry

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Unable to use bool type in i386.h
       [not found]     ` <CABJqhQOf-uMVq71_dVQ1pxZyX0Pd9yYW3PdYNHP5vk3hYFJPUw@mail.gmail.com>
@ 2013-11-22 14:34       ` Terry Guo
  2013-11-22 14:34         ` Jonathan Wakely
  0 siblings, 1 reply; 10+ messages in thread
From: Terry Guo @ 2013-11-22 14:34 UTC (permalink / raw)
  To: Jędrzej Dudkiewicz, gcc

On Fri, Nov 22, 2013 at 10:02 PM, Jędrzej Dudkiewicz
<jedrzej.dudkiewicz@gmail.com> wrote:
> On Fri, Nov 22, 2013 at 2:59 PM, Terry Guo <flameroc@gmail.com> wrote:
>> On Fri, Nov 22, 2013 at 8:53 PM, Rob <robpilling@gmail.com> wrote:
>>> It seems that C files include this, so you'll want _Bool, or just use an int.
>>>
>>
>> Thanks for your reply. I know I can use the int. But the bool type is
>> more precise. And now GCC is in C++, the bool type should be
>> supported. I am curious whether this is a missing part of GCC. Can
>> someone please help to confirm?
>
> I'm not an expert, but it seems that you are compiling *.c files. GCC
> being written in C++ does not change C language in any way, so bool
> won't work.
> --
> Jędrzej Dudkiewicz
>

But if you search i386.c, you will find many bool type variables. Why
it works for i386.c but not for i386.h?

BR,
Terry

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Unable to use bool type in i386.h
  2013-11-22 14:34       ` Terry Guo
@ 2013-11-22 14:34         ` Jonathan Wakely
  2013-11-22 14:38           ` Terry Guo
  0 siblings, 1 reply; 10+ messages in thread
From: Jonathan Wakely @ 2013-11-22 14:34 UTC (permalink / raw)
  To: Terry Guo; +Cc: Jędrzej Dudkiewicz, gcc

On 22 November 2013 14:09, Terry Guo wrote:
> But if you search i386.c, you will find many bool type variables. Why
> it works for i386.c but not for i386.h?

i386.h is a header, it's not only used in one place.

I assume your error is because i386.c is compiled as a C++ file, but
i386.h is included in a file that is compiled as a C file, e.g.
libgcc.c

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Unable to use bool type in i386.h
  2013-11-22 14:34         ` Jonathan Wakely
@ 2013-11-22 14:38           ` Terry Guo
  2013-11-22 14:57             ` Terry Guo
  2013-11-24 20:19             ` Ángel González
  0 siblings, 2 replies; 10+ messages in thread
From: Terry Guo @ 2013-11-22 14:38 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: Jędrzej Dudkiewicz, gcc

On Fri, Nov 22, 2013 at 10:34 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> On 22 November 2013 14:09, Terry Guo wrote:
>> But if you search i386.c, you will find many bool type variables. Why
>> it works for i386.c but not for i386.h?
>
> i386.h is a header, it's not only used in one place.
>
> I assume your error is because i386.c is compiled as a C++ file, but
> i386.h is included in a file that is compiled as a C file, e.g.
> libgcc.c

Yes. I have same understanding. Is it possible to compile libgcc.c as
a C++ file?

BR,
Terry

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Unable to use bool type in i386.h
  2013-11-22 14:38           ` Terry Guo
@ 2013-11-22 14:57             ` Terry Guo
  2013-11-22 19:40               ` Jonathan Wakely
  2013-11-24 20:19             ` Ángel González
  1 sibling, 1 reply; 10+ messages in thread
From: Terry Guo @ 2013-11-22 14:57 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: Jędrzej Dudkiewicz, gcc

On Fri, Nov 22, 2013 at 10:36 PM, Terry Guo <flameroc@gmail.com> wrote:
> On Fri, Nov 22, 2013 at 10:34 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>> On 22 November 2013 14:09, Terry Guo wrote:
>>> But if you search i386.c, you will find many bool type variables. Why
>>> it works for i386.c but not for i386.h?
>>
>> i386.h is a header, it's not only used in one place.
>>
>> I assume your error is because i386.c is compiled as a C++ file, but
>> i386.h is included in a file that is compiled as a C file, e.g.
>> libgcc.c
>
> Yes. I have same understanding. Is it possible to compile libgcc.c as
> a C++ file?
>

The i386.c is compiles as

g++ -c   -g -O2 -DIN_GCC    -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual
-Wmissing-format-attribute -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -fno-common
-DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/.
-I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include
-I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/bid
-I../libdecnumber -I../../gcc/gcc/../libbacktrace    -o i386.o -MT
i386.o -MMD -MP -MF ./.deps/i386.TPo ../../gcc/gcc/config/i386/i386.c

while the libgcc2.c is compiled as a pure C file. For GCC we have
something like GCC in C++, will we have something like LIBGCC in C++?

BR,
Terry

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Unable to use bool type in i386.h
  2013-11-22 14:57             ` Terry Guo
@ 2013-11-22 19:40               ` Jonathan Wakely
  0 siblings, 0 replies; 10+ messages in thread
From: Jonathan Wakely @ 2013-11-22 19:40 UTC (permalink / raw)
  To: Terry Guo; +Cc: Jędrzej Dudkiewicz, gcc

On 22 November 2013 14:50, Terry Guo wrote:
>
> while the libgcc2.c is compiled as a pure C file. For GCC we have
> something like GCC in C++, will we have something like LIBGCC in C++?

I don't know.  The public functions in libgcc are all C functions, so
would (at least) need to be declared extern "C" if compiled as C++.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Unable to use bool type in i386.h
  2013-11-22 14:38           ` Terry Guo
  2013-11-22 14:57             ` Terry Guo
@ 2013-11-24 20:19             ` Ángel González
  2013-11-25 17:50               ` Terry Guo
  1 sibling, 1 reply; 10+ messages in thread
From: Ángel González @ 2013-11-24 20:19 UTC (permalink / raw)
  To: Terry Guo; +Cc: Jonathan Wakely, Jędrzej Dudkiewicz, gcc

On 22/11/13 15:36, Terry Guo wrote:
> On Fri, Nov 22, 2013 at 10:34 PM, Jonathan Wakely<jwakely.gcc@gmail.com>  wrote:
>> On 22 November 2013 14:09, Terry Guo wrote:
>>> But if you search i386.c, you will find many bool type variables. Why
>>> it works for i386.c but not for i386.h?
>> i386.h is a header, it's not only used in one place.
>>
>> I assume your error is because i386.c is compiled as a C++ file, but
>> i386.h is included in a file that is compiled as a C file, e.g.
>> libgcc.c
> Yes. I have same understanding. Is it possible to compile libgcc.c as
> a C++ file?
>
> BR,
> Terry
IMHO the best solution would be to  #include <stdbool.h> in i386.h

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Unable to use bool type in i386.h
  2013-11-24 20:19             ` Ángel González
@ 2013-11-25 17:50               ` Terry Guo
  0 siblings, 0 replies; 10+ messages in thread
From: Terry Guo @ 2013-11-25 17:50 UTC (permalink / raw)
  To: Ángel González; +Cc: Jonathan Wakely, Jędrzej Dudkiewicz, gcc

On Mon, Nov 25, 2013 at 2:19 AM, Ángel González <keisial@gmail.com> wrote:
> On 22/11/13 15:36, Terry Guo wrote:
>>
>> On Fri, Nov 22, 2013 at 10:34 PM, Jonathan Wakely<jwakely.gcc@gmail.com>
>> wrote:
>>>
>>> On 22 November 2013 14:09, Terry Guo wrote:
>>>>
>>>> But if you search i386.c, you will find many bool type variables. Why
>>>> it works for i386.c but not for i386.h?
>>>
>>> i386.h is a header, it's not only used in one place.
>>>
>>> I assume your error is because i386.c is compiled as a C++ file, but
>>> i386.h is included in a file that is compiled as a C file, e.g.
>>> libgcc.c
>>
>> Yes. I have same understanding. Is it possible to compile libgcc.c as
>> a C++ file?
>>
>> BR,
>> Terry
>
> IMHO the best solution would be to  #include <stdbool.h> in i386.h
>

Thank you all. I did learned something behind the question. All of
your solutions can work. I will pick up the one that is fit for my
requirement.

BR,
Terry

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-11-25  5:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-22 12:54 Unable to use bool type in i386.h Terry Guo
2013-11-22 13:59 ` Rob
2013-11-22 14:09   ` Terry Guo
     [not found]     ` <CABJqhQOf-uMVq71_dVQ1pxZyX0Pd9yYW3PdYNHP5vk3hYFJPUw@mail.gmail.com>
2013-11-22 14:34       ` Terry Guo
2013-11-22 14:34         ` Jonathan Wakely
2013-11-22 14:38           ` Terry Guo
2013-11-22 14:57             ` Terry Guo
2013-11-22 19:40               ` Jonathan Wakely
2013-11-24 20:19             ` Ángel González
2013-11-25 17:50               ` Terry Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).