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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17333C433EF for ; Sun, 27 Feb 2022 23:57:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231290AbiB0X6e (ORCPT ); Sun, 27 Feb 2022 18:58:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230505AbiB0X6d (ORCPT ); Sun, 27 Feb 2022 18:58:33 -0500 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 332D14CD66 for ; Sun, 27 Feb 2022 15:57:56 -0800 (PST) Received: by mail-io1-xd2f.google.com with SMTP id s1so12981915iob.9 for ; Sun, 27 Feb 2022 15:57:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=TYixXH/oSVNIYPjWy8IDeErfQMBt7NeciGEbuByoJUQ=; b=VA7Y7/hwNTpAG0EJBvjzNcqWEEoLvSuaQCNj01nO45OyMQcgooOoCeTcGzsvRipjXT GR51Exj8tHYQvvBj7rj4BWHnSURg64uycJzHdUCB+hGxEtEhlwx2pPdKlhw0XhHwjAE/ I4bLKsSa7ST5UvIHRTX2rxKh1qtw9ZBdmZ77wJDCw6OPEltA1/Pz2/7JbQRL0duYZ4ct a7VUK+N8cmAKsjrWIe0Rajg2EbIFsIgRyubHIXT65zHok28ikdqymV+/J+ecIosK77WB vpTaCXz61HY+ci7o/cRo3ZW5ylwVRVT+7wiyD0oTOFySlCVCR7thfpDnSjzQN84bD+HM seNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=TYixXH/oSVNIYPjWy8IDeErfQMBt7NeciGEbuByoJUQ=; b=s+LrH/OysyoHR8yoZl8cAgEWO0AEPvPPdLubIIFxfcfI3rHOxVgyQ0M89a7+sNuQiK QD8/Bdr4tETdYvjlrsRAyUWEaukjJWmM+xNqf68RdnWQEv3AONXRp8ko7o2VYnkdg7n9 HjHMmCk79qme+KJdKKtLtHa9gABDky0n7mZyX06OZGFbE+0xWf/Xr/nIEYN0Tfgqh5C5 QxBo7a6Px44toLGSgRJssV/RuYNZyjP8d8rICjgUAt38jVFEFksjlwzf7WcVm2TyAS91 gEGHdf3VFoUMbiEioyWeIu9tqVjgOOVFIoGe65XgLjavNQMLoKZADoeT+cgwYmqbfPP/ Q3oQ== X-Gm-Message-State: AOAM5326fYIbidqbbCnNWW6+Hc4Dks+CfXVItQX+EtNFeMjY23Imugnp C6Hy7H3lSUwi0yd48nSZTJwg6w== X-Google-Smtp-Source: ABdhPJyPtYXXq4eTx/zm7hkEn1uc7x7ywQuCdrH5tLSdhR5RU9smY5dt5X0iXebRMULNf0pZ7UBpzA== X-Received: by 2002:a02:c64e:0:b0:311:b1b4:1a08 with SMTP id k14-20020a02c64e000000b00311b1b41a08mr14572997jan.230.1646006275352; Sun, 27 Feb 2022 15:57:55 -0800 (PST) Received: from [172.22.22.26] (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.googlemail.com with ESMTPSA id n7-20020a056602340700b006409737fa99sm5093280ioz.27.2022.02.27.15.57.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 15:57:54 -0800 (PST) Message-ID: <72ff1b04-4f37-9851-a6e6-aded72b46c83@linaro.org> Date: Sun, 27 Feb 2022 17:57:52 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [greybus-dev] [PATCH] Kbuild: remove -std=gnu89 from compiler arguments Content-Language: en-US To: Linus Torvalds Cc: Arnd Bergmann , Linux Kbuild mailing list , Arnd Bergmann , Masahiro Yamada , llvm@lists.linux.dev, Jonathan Corbet , Federico Vaga , Alex Shi , Hu Haowen , Michal Marek , Nick Desaulniers , "open list:DOCUMENTATION" , Linux Kernel Mailing List , linux-doc-tw-discuss@lists.sourceforge.net, Linux ARM , intel-gfx , dri-devel , greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev, linux-btrfs References: <20220227215408.3180023-1-arnd@kernel.org> From: Alex Elder In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On 2/27/22 5:11 PM, Linus Torvalds wrote: > On Sun, Feb 27, 2022 at 3:04 PM Alex Elder wrote: >> >> Glancing at the Greybus code, I don't believe there's any >> reason it needs to shift a negative value. Such warnings >> could be fixed by making certain variables unsigned, for >> example. > > As mentioned in the original thread, making things unsigned actually > is likely to introduce bugs and make things worse. Understood. What I meant is that the shifts were producing single-bit masks from plain int values that range from 0 to 10 or something (in a for loop). Looking again though, that it's not so simple. Regardless, your point about the warning is good and I won't plan to "fix" this. Thanks. -Alex > > The warning is simply bogus, and the fact that it was enabled by > -Wextra in gcc for std=gnu99 and up was a mistake that looks likely to > be fixed in gcc. > > So don't try to "fix" the code to make any possible warnings go away. > You may just make things worse. > > (That is often true in general for the more esoteric warnings, but in > this case it's just painfully more obvious). > > Linus