Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler warnings, second try #48

Merged
merged 3 commits into from
Apr 2, 2024
Merged

Fix compiler warnings, second try #48

merged 3 commits into from
Apr 2, 2024

Conversation

PhilMiller
Copy link
Contributor

@PhilMiller PhilMiller commented Apr 1, 2024

My previous PR #47 didn't get the flags right to actually match intentions, so the code changes to satisfy CI in that PR were incomplete. This PR fixes the flags to enforce our expectation of no compiler warnings, and fixes the code accordingly.

Changes

  • Fix variable name in CMake arguments in CI
  • Add -Og so that the compiler does analysis necessary to see that fgets() and fscanf() return values were unchecked
  • Check said return values, and report errors up the call stack through to BMI_FAILURE

Testing

  1. CI

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows project standards (link if applicable)
  • Passes all existing automated tests
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • Visually tested in supported browsers and devices (see checklist below 👇)
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
  • Reviewers requested with the Reviewers tool ➡️

Testing checklist

Target Environment support

  • Linux/GCC9 (Ubuntu 20.04)
  • macOS with AppleClang

@PhilMiller PhilMiller changed the title Fix variable name in CMake arguments in CI Fix compiler warnings, second try Apr 1, 2024
@PhilMiller PhilMiller marked this pull request as ready for review April 1, 2024 20:40
@PhilMiller PhilMiller requested a review from aaraney April 1, 2024 20:46
Copy link
Member

@aaraney aaraney left a comment

Choose a reason for hiding this comment

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

Thanks for making these improvements, @PhilMiller!

@@ -36,13 +36,13 @@ jobs:
run: |
cd ./test
make clean
make 'CFLAGS=-g -fsanitize=address -Werror'
make 'CFLAGS=-g -Og -fsanitize=address -Werror'
Copy link
Member

Choose a reason for hiding this comment

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

Neat! I wasn't aware of this flag.

@aaraney aaraney merged commit a4cb3ba into master Apr 2, 2024
4 checks passed
@PhilMiller PhilMiller deleted the PhilMiller/warnings-2 branch April 2, 2024 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants