This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Unable to use bool type in i386.h
- From: Terry Guo <flameroc at gmail dot com>
- To: Ángel González <keisial at gmail dot com>
- Cc: Jonathan Wakely <jwakely dot gcc at gmail dot com>, Jędrzej Dudkiewicz <jedrzej dot dudkiewicz at gmail dot com>, gcc <gcc-help at gcc dot gnu dot org>
- Date: Mon, 25 Nov 2013 13:53:03 +0800
- Subject: Re: Unable to use bool type in i386.h
- Authentication-results: sourceware.org; auth=none
- References: <CAGbRaL49voK6s0XDaTLfPxhPT12evu=i8dMrJ1g7DyHS9wovqw at mail dot gmail dot com> <CAPQ98VUtsfFupqML864+5d_90ZvOEacB5fiuA2pRgjX_5AffSw at mail dot gmail dot com> <CAGbRaL4h-WY3HytuZWxWdANXzkDqJS8XiWn53GsA2aO=Of0-tQ at mail dot gmail dot com> <CABJqhQOf-uMVq71_dVQ1pxZyX0Pd9yYW3PdYNHP5vk3hYFJPUw at mail dot gmail dot com> <CAGbRaL5g9Cxan5WDgyXWbz81UGBHLHee94ONbgNc=gatAouxFQ at mail dot gmail dot com> <CAH6eHdQ9qjFaaVSG+C55QrpgLCSSC0ASQc_tGawZFgb6rR99Jg at mail dot gmail dot com> <CAGbRaL4b4BOHB0ax7kPjm9SmyWMgUaKq6C3YBs3FY=OZoiJ9rg at mail dot gmail dot com> <52924326 dot 3010702 at gmail dot com>
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