Repository navigation
Fix CI failure on maybe-uninitialized compiler warning - #205
Merged
Merged
Conversation
Some GCC versions say:
ttyplot.c:359:16: error:
‘y2_start’ may be used uninitialized [-Werror=maybe-uninitialized]
and a similar warning (promoted to error) for y2_end. These are false
positives: the variables are initialized if they ever get used. It is,
however, easy to restructure the code in order to get the initialization
and usage of the variables under the same ‘if’ test, so let's silence
the warning this way.
Fixes: https://github.com/tenox7/ttyplot/actions/runs/17030161145/job/48271411839
This option is not needed anymore. Furthermore, it is not supported by clang. This reverts commits 8d8d752 ("fix gh actions") and 714f210 ("fix retarded flags"). Fixes: https://github.com/tenox7/ttyplot/actions/runs/17030161145/job/48271411825
tenox7
approved these changes
Oct 2, 2025
social4hyq
pushed a commit
to social4hyq/homebrew-core
that referenced
this pull request
Sep 20, 2026
ttyplot 1.7.5 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre>## What's Changed * Fix CI failure on maybe-uninitialized compiler warning by @edgar-bonet in tenox7/ttyplot#205 * CI: upgrade macOS runners by @edgar-bonet in tenox7/ttyplot#206 * Actions(deps): Bump codespell-project/actions-codespell from 2.1 to 2.2 by @dependabot[bot] in tenox7/ttyplot#208 * Avoid division by zero on small windows by @edgar-bonet in tenox7/ttyplot#214 * `ttyplot.c`: Fix in-code comment by @hartwork in tenox7/ttyplot#217 * Work on smaller windows with no clock display by @edgar-bonet in tenox7/ttyplot#215 **Full Changelog**: https://github.com/tenox7/ttyplot/compare/1.7.4...1.7.5</pre> <p>View the full release notes at <a href="https://github.com/tenox7/ttyplot/releases/tag/1.7.5">https://github.com/tenox7/ttyplot/releases/tag/1.7.5</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!12187
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some GCC versions warn:
These are false positives. However, in combination with the
-Werrorcompiler option, they cause a CI failure on GCC 14 / Ubuntu.Commits 8d8d752 and 714f210 attempted to fix the failure by providing the
-Wno-error=maybe-uninitializedcompiler option. However, they did not fix the failure on Ubuntu, and they caused another failure on clang 18 on macOS:This pull request solves the issue in a different way: by moving the initialization of
y2_startandy2_endcloser to where they are used (within the sameifstatement), the warning goes away. Then, the compiler option-Wno-error=maybe-uninitializedis not needed anymore.