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 623F3C433EF for ; Mon, 28 Feb 2022 20:44:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229870AbiB1UpA (ORCPT ); Mon, 28 Feb 2022 15:45:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229745AbiB1Uo4 (ORCPT ); Mon, 28 Feb 2022 15:44:56 -0500 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EAC8BC1B for ; Mon, 28 Feb 2022 12:44:17 -0800 (PST) Received: by mail-ed1-x532.google.com with SMTP id ee12so4615903edb.12 for ; Mon, 28 Feb 2022 12:44:17 -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=S/LNP14iVGpJY7HEU3KoWC3rGBeIOldyeXi/18P4YEg=; b=JCfpf2EkV0u8p2DIwI3SoZoRhHthQMEAy9/7LEkowc8JnTmPgsFXHlzh4U3t+Q6SEk Lc7ftzGO2kIrejoWkV3dzzd0jpx1zu67BigJ1Dmt6MH2aSREOTU5VOooJKZjMGKU+kco F0IyOo2hDxkf3WtcbllN4ffR7kqC0AZqO0I4w= 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=S/LNP14iVGpJY7HEU3KoWC3rGBeIOldyeXi/18P4YEg=; b=dR8Njd04OsCna4MgwMbdva+xLQt4slivFDoI77rVx5oMkveh7f9fy74clo51JItWeH DADKSzhDoOdzlzvB3yZHUyIzmXYRa6PDr+iDwd5Ime5AKlI5g01Pxrwku5V0M15JI9L/ ZKKw8mf6CDgc3ge2MkM7qdR/4ia5Ta828DcrI9arV/B4aszO2xPOnJnEz8hA0viLKy1g sLSoWVfGOz77U5FGD4s0LAr5gPAUd45gADv2omnDxPVgmb5T+ILA8Pnv61xT2QdjGPCq aGg7ntsPQZZcmoiJWJlicqO8ocTEJdNv6JoCjxlmFRHkbtIZfO4sp8KartPviFBUA++w 3x3A== X-Gm-Message-State: AOAM5320p9vvb5eWWvT6nwcj7719XWdZZjtNvuGOOj3Pj/NrOpLnWdig eub4G+UWGedv4kVOwCjqAanl/4F3iUPHJgx9Ybo= X-Google-Smtp-Source: ABdhPJz1NAiShMhUgvho+SQx6luuLIs4kJPMY4xcGr6zIeqdAu3CW0qrMVRLCe/QO/Iubm7WsMj6Zw== X-Received: by 2002:a05:6402:b8f:b0:3fd:90e9:ddac with SMTP id cf15-20020a0564020b8f00b003fd90e9ddacmr21418105edb.405.1646081055514; Mon, 28 Feb 2022 12:44:15 -0800 (PST) Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com. [209.85.218.50]) by smtp.gmail.com with ESMTPSA id g9-20020aa7c849000000b00412fc6bf26dsm6601108edt.80.2022.02.28.12.44.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Feb 2022 12:44:15 -0800 (PST) Received: by mail-ej1-f50.google.com with SMTP id r13so27313423ejd.5 for ; Mon, 28 Feb 2022 12:44:15 -0800 (PST) X-Received: by 2002:a2e:924d:0:b0:246:370c:5618 with SMTP id v13-20020a2e924d000000b00246370c5618mr15158756ljg.358.1646080652034; Mon, 28 Feb 2022 12:37:32 -0800 (PST) MIME-Version: 1.0 References: <20220228110822.491923-1-jakobkoschel@gmail.com> <20220228110822.491923-3-jakobkoschel@gmail.com> <2e4e95d6-f6c9-a188-e1cd-b1eae465562a@amd.com> In-Reply-To: From: Linus Torvalds Date: Mon, 28 Feb 2022 12:37:15 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr To: Matthew Wilcox Cc: =?UTF-8?Q?Christian_K=C3=B6nig?= , Jakob Koschel , alsa-devel@alsa-project.org, linux-aspeed@lists.ozlabs.org, "Gustavo A. R. Silva" , linux-iio@vger.kernel.org, nouveau@lists.freedesktop.org, Rasmus Villemoes , dri-devel , Cristiano Giuffrida , amd-gfx list , samba-technical@lists.samba.org, linux1394-devel@lists.sourceforge.net, drbd-dev@lists.linbit.com, linux-arch , CIFS , KVM list , linux-scsi , linux-rdma , linux-staging@lists.linux.dev, "Bos, H.J." , Jason Gunthorpe , intel-wired-lan@lists.osuosl.org, kgdb-bugreport@lists.sourceforge.net, bcm-kernel-feedback-list@broadcom.com, Dan Carpenter , Linux Media Mailing List , Kees Cook , Arnd Bergman , Linux PM , intel-gfx , Brian Johannesmeyer , Nathan Chancellor , linux-fsdevel , Christophe JAILLET , v9fs-developer@lists.sourceforge.net, linux-tegra , Thomas Gleixner , Andy Shevchenko , Linux ARM , linux-sgx@vger.kernel.org, linux-block , Netdev , linux-usb@vger.kernel.org, linux-wireless , Linux Kernel Mailing List , Linux F2FS Dev Mailing List , tipc-discussion@lists.sourceforge.net, Linux Crypto Mailing List , dma , linux-mediatek@lists.infradead.org, Andrew Morton , linuxppc-dev , Mike Rapoport Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 28, 2022 at 12:16 PM Matthew Wilcox wrote: > > Then we can never use -Wshadow ;-( I'd love to be able to turn it on; > it catches real bugs. Oh, we already can never use -Wshadow regardless of things like this. That bridge hasn't just been burned, it never existed in the first place. The whole '-Wshadow' thing simply cannot work with local variables in macros - something that we've used since day 1. Try this (as a "p.c" file): #define min(a,b) ({ \ typeof(a) __a = (a); \ typeof(b) __b = (b); \ __a < __b ? __a : __b; }) int min3(int a, int b, int c) { return min(a,min(b,c)); } and now do "gcc -O2 -S t.c". Then try it with -Wshadow. In other words, -Wshadow is simply not acceptable. Never has been, never will be, and that has nothing to do with the typeof(pos) pos kind of thing. Your argument just isn't an argument. Linus