Re: [PATCH 2/7] ASoC: rt5677: clean up gpiolib callbacks

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

 



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.

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux