From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0C0B173 for ; Sat, 24 Jul 2021 14:08:56 +0000 (UTC) Received: from mail-wr1-f47.google.com ([209.85.221.47]) by mrelayeu.kundenserver.de (mreue012 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MgARS-1lR3I83jna-00hidp for ; Sat, 24 Jul 2021 16:08:54 +0200 Received: by mail-wr1-f47.google.com with SMTP id z7so5344167wrn.11 for ; Sat, 24 Jul 2021 07:08:54 -0700 (PDT) X-Gm-Message-State: AOAM532JYOosjn32f76RDURYluHC6pjM4AaSflBNRbmgjfkXRqPQ9Dlj +2wDCJJ+SRGCWs1fUFMrc/Ng5SjQs1pqXl7MdYA= X-Google-Smtp-Source: ABdhPJyk9UH167EGmBlvYLcfUvK7o4Cs9ySlNun23iWai/yKxJ+Q+uyVCbnTjnMj29uBGnED1lI6NJrUK5cLo4sCMU4= X-Received: by 2002:a5d:65cb:: with SMTP id e11mr10508588wrw.105.1627135734496; Sat, 24 Jul 2021 07:08:54 -0700 (PDT) Precedence: bulk X-Mailing-List: ksummit@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20210723191023.GG25548@kadam> In-Reply-To: From: Arnd Bergmann Date: Sat, 24 Jul 2021 16:08:38 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Potential static analysis ideas To: Geert Uytterhoeven Cc: Dan Carpenter , ksummit@lists.linux.dev, Julia Lawall Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:he4bjyGVQgiRfAhUQUeVrAhr0dxzylZRSWglqoIrRZWYfnzUBy6 HyLapzu55fZnJahcoWr4C31niKVn+pBzXO5Ayd/YdTgcMSGELJXqNqZXA8AGU0Z3KufbyMz MsWbYXvzs7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ven wrote: > > Hi Dan, > > On Fri, Jul 23, 2021 at 9:11 PM Dan Carpenter wrote: > > These days we have disabled GCC's uninitialized warnings so it falls > > to static analysis devs to review all the new warnings. I sometimes > > ignore warnings if they look like probably they aren't a bug. Does this > > function allow zero size writes? Does this switch statement really need > > a default case? Maybe sometimes I miss bugs. > > Yeah, I tended to find a few real bugs every release using the good old > gcc 4.2, before support for it was dropped. > I hope someone still runs modern compilers with GCC's uninitialized > warnings enabled again? Unfortunately, the new inlining in gcc-10 and up has made the Wmaybe-uninitialized option pretty much unusable, especially since all the uninitialized_var() annotations are gone. I tried for a while to keep that running on my randconfig build machine, but the number of warnings that got added was overwhelming after a while. This does contain a number of real bugs, and at least clang and smatch can both catch a notable subset of those, but it would be good to have a replacement that warns developers about not adding uninitialized variable uses in the first place. Arnd