Transitioning from pa_bool_t to C99 bool

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/02/2012 09:26 AM, R?mi Denis-Courmont wrote:
> On Mon, 02 Jul 2012 08:45:42 +0200, David Henningsson
> <david.henningsson at canonical.com> wrote:
>> It might make sense to keep something like
>>
>> #ifndef HAVE_STD_BOOL
>> typedef int bool;
>
> I sincerely don't recommend that kind of hacks.
>
> int and bool are completely different things. The representation in memory
> may be different depending on the ABI. Furthermore, the conversion rule for
> the compiler are not the same. That can introduce subtle bugs on old
> compilers. I think it's best to fail explicitly than to hide bugs.

bool / pa_bool_t is not used in the public API/ABI, there we use only 
ints (for the reasons you claim above, I believe).

Does your point still stand even if it is only used internally?

-- 
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic




[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux