List:Internals« Previous MessageNext Message »
From:Tor Didriksen Date:September 8 2010 12:47pm
Subject:Re: [STYLE] use true/false in C++, not TRUE/FALSE
View as plain text  
On 2010-09-08 14:22, Mats Kindahl wrote:
>>> One way to avoid the problems that Mark points out is to redefine
>>> >>  my_bool to be "int". This would work for all places where my_bool
> is
>>> >>  used and IIRC, there are no places in ABIs where my_bool is used.
> If
>>> >>  there are, it is easy to replace them with "unsigned char" to
> ensure
>>> >>  that the ABI does not change.
>>> >>  
>>>        
>> >  naah, I think we want sizeof(my_bool) == 1
>>      
> Why?
>
> /Matz
>
>    
- save space
- compatibility with bool in C++ (and C99)

I encourage you to try 'typedef int my_bool;'
my guess is you will get quite a few errors to fix, both compile time 
and run-time

-- didrik

Thread
[STYLE] use true/false in C++, not TRUE/FALSEGuilhem Bichot26 Aug
  • Re: [STYLE] use true/false in C++, not TRUE/FALSERoy Lyseng26 Aug
  • Re: [STYLE] use true/false in C++, not TRUE/FALSEMARK CALLAGHAN26 Aug
    • Re: [STYLE] use true/false in C++, not TRUE/FALSEGuilhem Bichot31 Aug
      • Re: [STYLE] use true/false in C++, not TRUE/FALSEMARK CALLAGHAN31 Aug
        • Re: [STYLE] use true/false in C++, not TRUE/FALSEGuilhem Bichot31 Aug
          • Re: [STYLE] use true/false in C++, not TRUE/FALSEJay Pipes31 Aug
            • Re: [STYLE] use true/false in C++, not TRUE/FALSEDavi Arnaut31 Aug
              • Re: [STYLE] use true/false in C++, not TRUE/FALSEJay Pipes31 Aug
                • Re: [STYLE] use true/false in C++, not TRUE/FALSEDavi Arnaut31 Aug
                  • Re: [STYLE] use true/false in C++, not TRUE/FALSEMARK CALLAGHAN31 Aug
                    • Re: [STYLE] use true/false in C++, not TRUE/FALSEDavi Arnaut31 Aug
                      • Re: [STYLE] use true/false in C++, not TRUE/FALSEMARK CALLAGHAN31 Aug
                        • Re: [STYLE] use true/false in C++, not TRUE/FALSERoy Lyseng31 Aug
                          • Re: [STYLE] use true/false in C++, not TRUE/FALSEMARK CALLAGHAN31 Aug
                            • Re: [STYLE] use true/false in C++, not TRUE/FALSEMichael Widenius8 Sep
                              • Re: [STYLE] use true/false in C++, not TRUE/FALSEJay Pipes8 Sep
                          • RE: [STYLE] use true/false in C++, not TRUE/FALSEVladislav Vaintroub31 Aug
                            • Re: [STYLE] use true/false in C++, not TRUE/FALSERoy Lyseng31 Aug
                            • Re: [STYLE] use true/false in C++, not TRUE/FALSEDavi Arnaut31 Aug
                              • Re: [STYLE] use true/false in C++, not TRUE/FALSEMichael Widenius8 Sep
                                • Re: [STYLE] use true/false in C++, not TRUE/FALSEDavi Arnaut8 Sep
                                  • RE: [STYLE] use true/false in C++, not TRUE/FALSEVladislav Vaintroub8 Sep
                        • Re: [STYLE] use true/false in C++, not TRUE/FALSEMichael Widenius8 Sep
                      • Re: [STYLE] use true/false in C++, not TRUE/FALSEKonstantin Osipov8 Sep
                        • Re: [STYLE] use true/false in C++, not TRUE/FALSEMats Kindahl8 Sep
                          • Re: [STYLE] use true/false in C++, not TRUE/FALSETor Didriksen8 Sep
                            • Re: [STYLE] use true/false in C++, not TRUE/FALSEMats Kindahl8 Sep
                              • RE: [STYLE] use true/false in C++, not TRUE/FALSEVladislav Vaintroub8 Sep
                                • Re: [STYLE] use true/false in C++, not TRUE/FALSEMats Kindahl8 Sep
                              • Re: [STYLE] use true/false in C++, not TRUE/FALSETor Didriksen8 Sep
                                • Re: [STYLE] use true/false in C++, not TRUE/FALSEMats Kindahl8 Sep
                  • Re: [STYLE] use true/false in C++, not TRUE/FALSEJay Pipes31 Aug
        • Re: [STYLE] use true/false in C++, not TRUE/FALSEMichael Widenius8 Sep
      • Re: [STYLE] use true/false in C++, not TRUE/FALSEMARK CALLAGHAN31 Aug
  • Re: [STYLE] use true/false in C++, not TRUE/FALSEMats Kindahl27 Aug
    • Re: [STYLE] use true/false in C++, not TRUE/FALSEMichael Widenius8 Sep