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 3504FC6FD1D for ; Mon, 20 Mar 2023 23:44:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230030AbjCTXn6 (ORCPT ); Mon, 20 Mar 2023 19:43:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230042AbjCTXn4 (ORCPT ); Mon, 20 Mar 2023 19:43:56 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AF09C655 for ; Mon, 20 Mar 2023 16:43:09 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id cn12so7651153edb.4 for ; Mon, 20 Mar 2023 16:43:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1679355730; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=yh9V5oLNl71ZE8wLJrHU90qn5FMul3QSy4jMGg+s0h4=; b=N4wVROOxKzQ4OoNcx8r5uTzsGb3CGCAyBDkN21Yg7Ibmi8awtnbTHYbFslExfamja/ XTM1YvfD/UrKoD1ItfOmSDYXiKENfbGZQ5liaJggvBqVMf0Hs+UTvdbIxy95Kszei7pp Wo0DXOsYVQZLQVXcTOkM9muZUJt416sTmJ7z4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679355730; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yh9V5oLNl71ZE8wLJrHU90qn5FMul3QSy4jMGg+s0h4=; b=sVanLATn2UC1kWi9XjFoiRzoUQ+UKrbEcE1Ls9HQwgNilsl/YR7R06nM74h+9/8Eif g8QIVvUtbAITakFJkuFNfZKtqQoL2uht/qYEZogfAcu823pMAbllQ+o07ds98yBXe8iI xh8ZdVR9XOE0jkdtC2/IJVAY01DJaqJGLNxzIdqHKz3WwYRREbIGDial8KiKGnnQirYp 2zN1tVqGgmeuvmtj/LHHL3n+eQHr2X/fMX2LjFyfCUjswJlLg7CnLbgQ29XzOTBqxKAf JWoopP5ohramh3MSRG/FHaVA792BRdLaa749S0riKapp2yxbwhzkzoMUxjy1OZbdAm52 FSpQ== X-Gm-Message-State: AO0yUKX7U0HIfcISr/92SfVJGoHmrUF5kerP6BhWPaGTqDBLs/7dFJ1T uZ2FVgfxuWqIg/dlbk7Aj1dV54NayzFSLdB+eCoN77LS X-Google-Smtp-Source: AK7set8apmKmQxv6lsHsz98CuyZxhkQgkwk2uF1dUJV+QdMZljzpSlZpOnyFviX5d1ntEFF+uqIWfA== X-Received: by 2002:a17:906:579a:b0:931:3a85:d0bf with SMTP id k26-20020a170906579a00b009313a85d0bfmr845914ejq.17.1679355730551; Mon, 20 Mar 2023 16:42:10 -0700 (PDT) Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com. [209.85.208.49]) by smtp.gmail.com with ESMTPSA id gu12-20020a170906f28c00b008b17de9d1f2sm5098693ejb.15.2023.03.20.16.42.09 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Mar 2023 16:42:10 -0700 (PDT) Received: by mail-ed1-f49.google.com with SMTP id h8so53257640ede.8 for ; Mon, 20 Mar 2023 16:42:09 -0700 (PDT) X-Received: by 2002:a17:906:13d3:b0:931:2bcd:ee00 with SMTP id g19-20020a17090613d300b009312bcdee00mr395674ejc.15.1679355729667; Mon, 20 Mar 2023 16:42:09 -0700 (PDT) MIME-Version: 1.0 References: <20230320180501.GA598084@dev-arch.thelio-3990X> <4adbed5a-6f73-42ac-b7be-e12c764ae808@roeck-us.net> <20230320220631.GA637514@dev-arch.thelio-3990X> In-Reply-To: <20230320220631.GA637514@dev-arch.thelio-3990X> From: Linus Torvalds Date: Mon, 20 Mar 2023 16:41:52 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Linux 6.3-rc3 To: Nathan Chancellor Cc: Guenter Roeck , Linux Kernel Mailing List , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-toolchains@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-toolchains@vger.kernel.org On Mon, Mar 20, 2023 at 3:06=E2=80=AFPM Nathan Chancellor wrote: > > Right, this seems like a subtle difference in semantics between > -Wuninitialized between clang and GCC. I guess it's a bit ambiguous whether it's "X may be USED uninitialized" or whether it is "X may BE uninitialized" and then depending on how you see that ambiguity, the control flow matters. In this case, there is absolutely no question that the variable is uninitialized (since there is no write to it at all). So it is very clearly and unambiguously uninitialized. And I do think that as a result, "-Wuninitialized" should warn. But at the same time, whether it is *used* or not depends on that conditional, so I can see how it could be confusing and not be so clear an unambiguous. On the whole, I do wish that the logic would be "after dead code removal, if some pseudo has no initializer, it should always warn, regardless of any remaining dynamic conditoinals". That "after dead code removal" might matter, because I could see where config things (#ifdef's etc) would just remove the initialization of some variable, and if the use is behind some static "if (0)", then warning about it is all kinds of silly. Linus