Skip to content

Delete GCC static analysis CI#1950

Merged
ISSOtm merged 1 commit intogbdev:masterfrom
ISSOtm:fold-analysis
Apr 14, 2026
Merged

Delete GCC static analysis CI#1950
ISSOtm merged 1 commit intogbdev:masterfrom
ISSOtm:fold-analysis

Conversation

@ISSOtm
Copy link
Copy Markdown
Member

@ISSOtm ISSOtm commented Apr 14, 2026

EDIT: scope was changed after #1950 (comment)


This does raise at least one warning, which thus fails the build. That does goes on to show that we weren't paying attention to them before!

@ISSOtm ISSOtm requested a review from Rangi42 April 14, 2026 01:26
@ISSOtm ISSOtm added enhancement Typically new features; lesser priority than bugs meta This isn't related to the tools directly: repo organization, maintainership... labels Apr 14, 2026
Copy link
Copy Markdown
Contributor

@Rangi42 Rangi42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually do occasionally check the analysis workflow! But as you can see, this is a new warning now that the analysis runs on Ubuntu 22.04, not just ubuntu-latest. (Nice coverage improvement!)

Comment thread .github/workflows/testing.yml Outdated
Comment thread CMakeLists.txt Outdated
-Wno-unused-but-set-variable # bison's `yynerrs_` is incremented but unused
-Wno-type-limits -Wno-tautological-constant-out-of-range-compare
-Wvla) # MSVC does not support VLAs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Comment thread CMakeLists.txt Outdated
# Note that GCC's static analyzer is not supported by other GNU-like compilers like Clang.
cmake_dependent_option(GCC_STATIC_ANALYZER "Enable GCC's static analyzer" OFF "CMAKE_CXX_COMPILER_ID STREQUAL \"GNU\"" OFF)
mark_as_advanced(GCC_STATIC_ANALYZER)
# It is also very expensive, both in terms of CPU and RAM.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# It is also very expensive, both in terms of CPU and RAM.
# It is also very expensive, both in terms of CPU and RAM, so mark it as advanced.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That comment was related to why it's not enabled by default as part of our develop profile; the rationale for marking it as “advanced” is that downstream users shouldn't need to care about it. (I think we should do the same with e.g. MORE_WARNINGS, but I'm still thinking about it and thus saving it for another PR.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment being right above the mark_as_advanced line, instead of right after the "Note that" sentence comment (which would be the natural way to read it, as one sentence continuing another) made me think that it was here for a reason, to describe the subsequent line. If "very expensive" is justifying the OFF, it should definitely be above the the with the OFF in it.

(And I don't really understand why to bother using mark_as_advanced anyway; doesn't that just inconveniently hide it from users who didn't already know to opt in to "advanced" mode when checking their GUI's option flags list? It's a bit like needing to pass man foobar --advanced to actually see how foobar works.)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I don't know of any official guidance on what to mark as Advanced, but I think it's useful to treat it like CMake's -Wdev versus -Wno-dev: non-advanced things are intended to be usable by anyone using our build system, whereas “advanced” toggles are maintainer-oriented instead. Which thus makes sense to hide unless it's opted into.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note also that this comment is below the mark_as_advanced line.

@Rangi42
Copy link
Copy Markdown
Contributor

Rangi42 commented Apr 14, 2026

Okay, so the new analysis error is:

src/cli.cpp:83:16: error: dereference of NULL ‘__dest’ [CWE-476] [-Werror=analyzer-null-dereference]

This is the relevant code:

    83          struct AtFileStackEntry {
    84                  int parentInd;            // Saved offset into parent argv
    85                  std::vector<char *> argv; // This context's arg pointer vec
    86
    87                  AtFileStackEntry(int parentInd_, std::vector<char *> argv_)
    88                      : parentInd(parentInd_), argv(argv_) {}
    89          };

I'm pretty sure __dest is some internal field of the std::vector<char *> argv;, and that this is another false positive.

Actually, gcc's current docs say:

The analyzer is only suitable for use on C code in this release.

@ISSOtm So maybe we should just not be running this expensive CI step at all.

@ISSOtm
Copy link
Copy Markdown
Member Author

ISSOtm commented Apr 14, 2026

At this point, I'm questioning whether we want to have any such support at all. How about I turn this PR into just deleting analysis.yml?

@Rangi42
Copy link
Copy Markdown
Contributor

Rangi42 commented Apr 14, 2026

At this point, I'm questioning whether we want to have any such support at all. How about I turn this PR into just deleting analysis.yml?

Sounds fine to me.

As for GCC 15, it is stated not to be suitable for C++ code,
and we have gotten annoyingly many false positives out of it,
so let's just disable it (as per
gbdev#1950 (comment)).
@ISSOtm ISSOtm changed the title Fold analysis workflow into regression testing Delete GCC static analysis CI Apr 14, 2026
@ISSOtm ISSOtm dismissed Rangi42’s stale review April 14, 2026 13:17

Scope's been pivoted

@ISSOtm ISSOtm requested a review from Rangi42 April 14, 2026 13:17
@ISSOtm ISSOtm merged commit ac0f93f into gbdev:master Apr 14, 2026
23 checks passed
@ISSOtm ISSOtm deleted the fold-analysis branch April 14, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Typically new features; lesser priority than bugs meta This isn't related to the tools directly: repo organization, maintainership...

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants