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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YFCY2s/6+2f7Qycf@smile.fi.intel.com>
Date:   Tue, 16 Mar 2021 13:39:06 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Rasmus Villemoes <linux@...musvillemoes.dk>
Cc:     Yury Norov <yury.norov@...il.com>, linux-kernel@...r.kernel.org,
        linux-m68k@...ts.linux-m68k.org, linux-arch@...r.kernel.org,
        linux-sh@...r.kernel.org, Alexey Klimov <aklimov@...hat.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Arnd Bergmann <arnd@...db.de>, David Sterba <dsterba@...e.com>,
        Dennis Zhou <dennis@...nel.org>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        Jianpeng Ma <jianpeng.ma@...el.com>,
        Joe Perches <joe@...ches.com>,
        John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        Rich Felker <dalias@...c.org>,
        Stefano Brivio <sbrivio@...hat.com>,
        Wei Yang <richard.weiyang@...ux.alibaba.com>,
        Wolfram Sang <wsa+renesas@...g-engineering.com>,
        Yoshinori Sato <ysato@...rs.sourceforge.jp>
Subject: Re: [PATCH 01/13] tools: disable -Wno-type-limits

On Tue, Mar 16, 2021 at 09:17:24AM +0100, Rasmus Villemoes wrote:
> On 16/03/2021 02.54, Yury Norov wrote:
> > GENMASK(h, l) may be passed with unsigned types. In such case, type-limits
> > warning is generated for example in case of GENMASK(h, 0).

...

> I don't like that kind of collateral damage. I seem to recall another
> instance where a macro was instead rewritten to avoid triggering the
> type-limits warning (with a comment explaining the uglyness). Something like
> 
> foo > bar      is the same as
> !(foo <= bar)  which is the same as
> !(foo == bar || foo < bar)
> 
> Dunno if that would work here, but if it did, it would have the bonus
> that when somebody builds the kernel proper with Wtype-limits enabled
> (maybe W=1 or W=2) there would be no false positives from GENMASK to
> wade through.
> 
> Alternatively, we really should consider making use of _Pragma to
> locally disable/re-enable certain warnings.

Rasmus, in the kernel the same was fixed as per 355a3587d4ca.
I don't know why tools should be different to that.

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ