[alsa-devel] [PATCH 2/7] ASoC: rt5677: clean up gpiolib callbacks

Mark Brown broonie at kernel.org
Wed Jun 3 13:38:56 CEST 2015


On Wed, Jun 03, 2015 at 12:54:22AM +0300, Vladimir Zapolskiy wrote:

> Of course I'm not a C standard writer, but I have a feeling that one day
> bool type may become quite distinct from int (or in other words bool
> type will not be one of integer types). This may explain why C99 and C11
> has "_Bool" type, not a hypothetically finalized in future "bool" type.
> Also C99 clearly states that macro "false" and "true" may be undefined
> and redefined to any arbitrary values.

You're confusing several different things here - it's just the same as
the handling of NULL and 0.  An implementation can make NULL be anything
that amuses it (so long as nothing standards conforming can tell) but if
you write 0 in a pointer context it has to be a NULL pointer, and if you
use a NULL pointer in an integer context it must evaluate to 0.  The in
memory representation is potentially a separate thing to what the source
code does, though practically speaking people are unlikely to implment
anything too extravagent.

I suspect you'll find that the use of _Bool in current standards is
simply to avoid breaking existing standards conforming code that uses
bool by suddenly making that a keyword.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20150603/e8eab94a/attachment-0001.sig>


More information about the Alsa-devel mailing list