lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.1810280932030.2450@hadrien>
Date:   Sun, 28 Oct 2018 09:47:15 +0100 (CET)
From:   Julia Lawall <julia.lawall@...6.fr>
To:     Himanshu Jha <himanshujha199640@...il.com>
cc:     Sasha Levin <sashal@...nel.org>,
        Shayenne da Luz Moura <shayenneluzmoura@...il.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Hans de Goede <hdegoede@...hat.com>,
        Michael Thayer <michael.thayer@...cle.com>,
        devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
        outreachy-kernel@...glegroups.com
Subject: Re: [Outreachy kernel] [RESEND PATCH 2/2] staging: vboxvideo: Use
 unsigned int instead bool

> The "possible alignement issues" in CHECK report is difficult to figure
> out by just doing a glance analysis. :)
>
> Linus also suggested to use bool as the base type i.e., `bool x:1` but
> again sizeof(_Bool) is implementation defined ranging from 1-4 bytes.

If bool x:1 has the size of bool, then wouldn't int x:1 have the size of
int?  But my little experiments suggest that the size is the smallest that
fits the requested bits and alignment chosen by the compiler, regardless of
the type.

bool x:1 has the advantage that anything that is not 0 is considered true.
So for bool x:1, x = 4 is true, while for int x:1, x = 4 is false.

But the :1 adds instructions, so at least for only one bool, where little
space is saved, it is probably not worth it.

julia

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ