From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99AC6C433E6 for ; Tue, 16 Mar 2021 11:40:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 57F5765023 for ; Tue, 16 Mar 2021 11:40:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237346AbhCPLjm (ORCPT ); Tue, 16 Mar 2021 07:39:42 -0400 Received: from mga05.intel.com ([192.55.52.43]:60586 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237378AbhCPLjQ (ORCPT ); Tue, 16 Mar 2021 07:39:16 -0400 IronPort-SDR: efRc5xOzUO1aTnzdFLwvLotVSiB9C+rZwpRzjOKISAR8Kc3jbMYGZTqhQPHY0wEZfPDelgqS18 qz2jayj9ryUg== X-IronPort-AV: E=McAfee;i="6000,8403,9924"; a="274285882" X-IronPort-AV: E=Sophos;i="5.81,251,1610438400"; d="scan'208";a="274285882" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2021 04:39:14 -0700 IronPort-SDR: Uu2NYVQV19jKW3IGxrZ2iulFHr94qoOPZaU73rbJrxGCF6Y+mgSxp+07W1GwSt8HuBhreBQCs8 ChLlPdnlWyYQ== X-IronPort-AV: E=Sophos;i="5.81,251,1610438400"; d="scan'208";a="440062397" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2021 04:39:10 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lM82U-00CwLD-Dt; Tue, 16 Mar 2021 13:39:06 +0200 Date: Tue, 16 Mar 2021 13:39:06 +0200 From: Andy Shevchenko To: Rasmus Villemoes Cc: Yury Norov , linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-arch@vger.kernel.org, linux-sh@vger.kernel.org, Alexey Klimov , Andrew Morton , Arnd Bergmann , David Sterba , Dennis Zhou , Geert Uytterhoeven , Jianpeng Ma , Joe Perches , John Paul Adrian Glaubitz , Josh Poimboeuf , Rich Felker , Stefano Brivio , Wei Yang , Wolfram Sang , Yoshinori Sato Subject: Re: [PATCH 01/13] tools: disable -Wno-type-limits Message-ID: References: <20210316015424.1999082-1-yury.norov@gmail.com> <20210316015424.1999082-2-yury.norov@gmail.com> <2ec71f83-f903-2775-bf04-7f0a83c9f4cb@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2ec71f83-f903-2775-bf04-7f0a83c9f4cb@rasmusvillemoes.dk> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org 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