[Bug analyzer/105264] -Wanalyzer-use-of-uninitialized-value gets confused about var + i v.s. [i]

2022-04-15 Thread avarab at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105264 --- Comment #9 from Ævar Arnfjörð Bjarmason --- Thanks a lot, I can confirm that this fixes the issue in builtin/merge-file.c in git.git.

[Bug analyzer/105285] False positive with -Wanalyzer-null-dereference in git.git's reftable/reader.c

2022-04-15 Thread avarab at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105285 --- Comment #2 from Ævar Arnfjörð Bjarmason --- This code also errors under -Werror=analyzer-too-complex, including in some adjacent code, so perhaps the analyzer gave up?

[Bug analyzer/105285] False positive with -Wanalyzer-null-dereference in git.git's reftable/reader.c

2022-04-15 Thread avarab at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105285 --- Comment #1 from Ævar Arnfjörð Bjarmason --- Created attachment 52814 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52814=edit A patch to git.git that works around the -fanalyzer false positive A fix to git.git to work around the

[Bug analyzer/105285] New: False positive with -Wanalyzer-null-dereference in git.git's reftable/reader.c

2022-04-15 Thread avarab at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105285 Bug ID: 105285 Summary: False positive with -Wanalyzer-null-dereference in git.git's reftable/reader.c Product: gcc Version: 12.0 Status: UNCONFIRMED

[Bug c++/87404] Implement -Wenum-compare and -Wenum-compare-switch

2022-04-14 Thread avarab at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87404 --- Comment #10 from Ævar Arnfjörð Bjarmason --- Thanks, just clarifying. I saw this one was in the C++ component unlike the other one. On Thu, Apr 14, 2022, 19:57 egallager at gcc dot gnu.org < gcc-bugzi...@gcc.gnu.org> wrote: >

[Bug analyzer/105273] -Wanalyzer-use-of-uninitialized-value warns on "missing" default for switch when callers can be statically determined

2022-04-14 Thread avarab at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105273 --- Comment #2 from Ævar Arnfjörð Bjarmason --- ...To finish the report (Bugzilla's eager submitting threw me for a loop) the issue is that while the analyzer is right in the *general* case about a "switch" with a missing "default" being

[Bug analyzer/105273] -Wanalyzer-use-of-uninitialized-value warns on "missing" default for switch when callers can be statically determined

2022-04-14 Thread avarab at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105273 --- Comment #1 from Ævar Arnfjörð Bjarmason --- Created attachment 52808 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52808=edit test case without an enum A slightly amended test case, showing that the enum isn't per-se the issue (same

[Bug analyzer/105273] New: -Wanalyzer-use-of-uninitialized-value warns on "missing" default for switch when callers can be statically determined

2022-04-14 Thread avarab at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105273 Bug ID: 105273 Summary: -Wanalyzer-use-of-uninitialized-value warns on "missing" default for switch when callers can be statically determined Product: gcc

[Bug analyzer/105264] -Wanalyzer-use-of-uninitialized-value gets confused about var + i v.s. [i]

2022-04-14 Thread avarab at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105264 --- Comment #4 from Ævar Arnfjörð Bjarmason --- Created attachment 52806 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52806=edit testcase-full.c (gcc -E of testcase.c) The gcc -E version of testcase.c, probably useless since it only

[Bug analyzer/105264] -Wanalyzer-use-of-uninitialized-value gets confused about var + i v.s. [i]

2022-04-14 Thread avarab at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105264 Ævar Arnfjörð Bjarmason changed: What|Removed |Added CC||avarab at gmail dot com ---

[Bug analyzer/105264] -Wanalyzer-use-of-uninitialized-value gets confused about var + i v.s. [i]

2022-04-14 Thread avarab at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105264 --- Comment #2 from Ævar Arnfjörð Bjarmason --- I think I can do one better. Here's a stand-alone reproducible test case without any headers except standard headers, I've expanded the gcc -E version of that too, but presumably you won't need

[Bug c++/87404] Implement -Wenum-compare and -Wenum-compare-switch

2022-04-14 Thread avarab at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87404 --- Comment #8 from Ævar Arnfjörð Bjarmason --- Eric: I filed bug 87983. I think it makes sense to mark it as a duplicate only if this one covers both C and C++, right now the "component" for this one is C++. As bug 87983 notes in passing C

[Bug analyzer/105264] New: -Wanalyzer-use-of-uninitialized-value gets confused about var + i v.s. [i]

2022-04-13 Thread avarab at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105264 Bug ID: 105264 Summary: -Wanalyzer-use-of-uninitialized-value gets confused about var + i v.s. [i] Product: gcc Version: 12.0 Status: UNCONFIRMED Severity:

[Bug c/87983] Feature: Add a warning when case labels from a different enum than the one in switch(EXPR) are used

2022-01-20 Thread avarab at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87983 --- Comment #4 from Ævar Arnfjörð Bjarmason --- (In reply to Eric Gallager from comment #3) > Is the expectation that this would come from -Wswitch, -Wswitch-enum, > -Wenum-compare, -Wenum-conversion, or some new flag? I think a new flag would