ternary vs double exclamation

John de la Garza john at jjdev.com
Wed Jan 7 23:46:52 EST 2015


On Sun, Jan 04, 2015 at 04:50:58PM -0800, Greg KH wrote:
> On Sun, Jan 04, 2015 at 06:43:22PM -0500, John de la Garza wrote:
> > I assume it is a bad idea to depend on true being 1, right?  I mean, I
> > should assume that true could be changed to any non 0 value in the
future,
> > right?
>
> Why would that matter?  Just always test for "true" and "false" and you
> will be fine.
>

What if you need to store the value in a bitmap that needs
to be 1 or 0 so they can be shifted/anded in?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150107/f35493f4/attachment.html 


More information about the Kernelnewbies mailing list