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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E74AC433F5 for ; Tue, 1 Mar 2022 21:15:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 949868D0002; Tue, 1 Mar 2022 16:15:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8F7A18D0001; Tue, 1 Mar 2022 16:15:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 80DB38D0002; Tue, 1 Mar 2022 16:15:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0162.hostedemail.com [216.40.44.162]) by kanga.kvack.org (Postfix) with ESMTP id 72ECA8D0001 for ; Tue, 1 Mar 2022 16:15:28 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 30E3D181C9BBC for ; Tue, 1 Mar 2022 21:15:28 +0000 (UTC) X-FDA: 79197073536.21.FDCE3AB Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) by imf14.hostedemail.com (Postfix) with ESMTP id 9639510000A for ; Tue, 1 Mar 2022 21:15:27 +0000 (UTC) Received: by mail-lj1-f174.google.com with SMTP id bn33so23609051ljb.6 for ; Tue, 01 Mar 2022 13:15:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AFFQZ5G9629SYwN4GslubcgtNOJHtDCYyH5rTLKNhPs=; b=J7SNKN4+VaeirWCC/sELTWGxD9feSOxwo5q96qWEAmukJiV3VyojWYDxtxuMGxCyR3 YrpHXPdAb07nriCJ8cCpxklbaMU6iL5ozLyyOZQ0PKB6soH/RogNt2jYscdgsizouIbx qbKugFzE7mJwHl02BxHXOCWjpLGFgeV/WWue0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AFFQZ5G9629SYwN4GslubcgtNOJHtDCYyH5rTLKNhPs=; b=vHWH65Vh3tfqaMD2UH0uAaZkWsncx+SPvpPfvtyO5RS0dfm2nC8dDR3WjvRlMgu1H1 ZsBiTgjiec3jIpJNLZw2RbPo0AchTNHdCmmn0UQHRCLQ87qwV/lV7bSFLYJIbR+7AzV9 Kq0wECLk6CLOpLr5gDDNF6hznpqRi8K1F6zkQS42z1I5CcJFnldTzIDkada6mg0kFGx1 G82hFPRL+RgbSFgKTSOxwsHaxH6mBkNUWJ4Si/KwXowpDr+BD/xz51E68airHhPQPUHY 7eueRG81PBYDGgHpKnCMFuH97gE+ipLzktvDAWcb3lxE+2GE09enFJSYb4GHsQBb5vwV pYog== X-Gm-Message-State: AOAM531qTadGh2lAsgEeFM1Vd6HxqgPyzBg+twhzWtetcmxAHrxANTDm h52m2Z+T0qoO/+ZU26ZHD3Z6ZVPb7RmcppiZflY= X-Google-Smtp-Source: ABdhPJzc6tCTNZyz/6Ko8CR0FM0RWHo8Zbkz14r1iYmxZM1/FKL8J1MapYnv6m+45iME5uoQps0Eww== X-Received: by 2002:a2e:80c6:0:b0:244:e40a:75bc with SMTP id r6-20020a2e80c6000000b00244e40a75bcmr18663455ljg.519.1646169325824; Tue, 01 Mar 2022 13:15:25 -0800 (PST) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com. [209.85.208.172]) by smtp.gmail.com with ESMTPSA id a10-20020a05651c210a00b00245f4dc7282sm2165475ljq.112.2022.03.01.13.15.23 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Mar 2022 13:15:23 -0800 (PST) Received: by mail-lj1-f172.google.com with SMTP id s25so23584422lji.5 for ; Tue, 01 Mar 2022 13:15:23 -0800 (PST) X-Received: by 2002:a2e:3013:0:b0:246:2ca9:365e with SMTP id w19-20020a2e3013000000b002462ca9365emr18180017ljw.291.1646169323173; Tue, 01 Mar 2022 13:15:23 -0800 (PST) MIME-Version: 1.0 References: <20220301075839.4156-2-xiam0nd.tong@gmail.com> <202203020135.5duGpXM2-lkp@intel.com> In-Reply-To: From: Linus Torvalds Date: Tue, 1 Mar 2022 13:15:06 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/6] Kbuild: compile kernel with gnu11 std To: Arnd Bergmann Cc: kernel test robot , Xiaomeng Tong , kbuild-all@lists.01.org, Jakob Koschel , Linux Kernel Mailing List , Greg Kroah-Hartman , Kees Cook , Jann Horn , Linux Kbuild mailing list , Linux-MM , Netdev Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 9639510000A X-Stat-Signature: fes1w9co6o3phkmpxmf8cft4zmzmjx8x Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=J7SNKN4+; spf=pass (imf14.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.208.174 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1646169327-70178 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Mar 1, 2022 at 1:04 PM Linus Torvalds wrote: > > Yeah, looks like that "<< 16" is likely just wrong. .. and perhaps more importantly, I guess that means that -Wshift-overflow is (a) somehow new to -std=gnu11 (b) possibly a lot more relevant and good than that -Wshift-negative-value thing was doing some grepping, it seems like we have never had that '-Wshift-overflow' even in any extra warnings. And trying it myself (keeping -std=gnu89), enabling it doesn't report anything on a x86-64 allmodconfig build. So I think this is likely a good new warning that -std=gnu11 brought in by accident. No false positives that I can see, and one report for a MIPS bug that looks real (but admittedly not a "sky-is-falling" one ;) There's apparently a '-Wshift-overflow=2' mode too, but that warns about things that change the sign bit, ie expressions like 1<<31 warns. And I would not be in the least surprised if we had a ton of those kinds of things all over (but I didn't check). So the plain -Wshift-overflow seems to work just fine, and while it's surprising that it got enabled by gnu11, I think it's all good. Famous last words. Linus