Skip to content

Clean up GNU compiler warnings#117

Merged
fluidnumerics-joe merged 5 commits intomainfrom
cleanup-warnings
Mar 10, 2026
Merged

Clean up GNU compiler warnings#117
fluidnumerics-joe merged 5 commits intomainfrom
cleanup-warnings

Conversation

@fluidnumerics-joe
Copy link
Member

Summary

  • -Wc-binding-type: Replace integer(kind(hipSuccess)) and integer(kind(HIPBLAS_STATUS_SUCCESS)) with explicit integer(c_int) in all BIND(C) function interfaces in SELF_GPU.f90 and SELF_GPUBLAS.f90
  • -Wunused-dummy-argument: Add if (.false.) references in stub/default method implementations across SELF_Model.f90, SELF_DGModel*_t.f90, SELF_Linear*_t.f90, SELF_Mapped*_t.f90, scalar/vector/tensor _t.f90 files, and gpu/*.f90 — suppresses the warning without affecting behavior or requiring pure-procedure-incompatible I/O
  • -Wunused-variable: Remove unused local variable declarations (ivar, WORKSPACE, imat, E, r, i, j, iel, s2, diff, nhat, nmag, fx, fy, etc.) throughout src/, test/, and examples/
  • -Wmaybe-uninitialized: Initialize the allocatable str variable before first use in SELF_Model.f90 to eliminate a false-positive flow-analysis warning

Test plan

  • Verify the CI build on AMD MI210 produces no GNU compiler warnings
  • Confirm all existing tests still pass

🤖 Generated with Claude Code

fluidnumerics-joe and others added 2 commits March 5, 2026 16:51
Fix all -Wc-binding-type, -Wunused-dummy-argument, -Wunused-variable,
and -Wmaybe-uninitialized warnings reported by gfortran in the CI build:

- SELF_GPU.f90, SELF_GPUBLAS.f90: use integer(c_int) instead of
  integer(kind(hipSuccess)) / integer(kind(HIPBLAS_STATUS_SUCCESS))
  in BIND(C) function return types and value arguments to satisfy
  -Wc-binding-type
- SELF_Model.f90, SELF_DGModel*_t.f90, SELF_Linear*_t.f90,
  SELF_Mapped*_t.f90, scalar/vector/tensor _t.f90 files, gpu/*.f90:
  add `if (.false.)` references in stub/default implementations to
  suppress -Wunused-dummy-argument without affecting behavior
- Remove unused local variable declarations (ivar, WORKSPACE, imat,
  E, r, i, j, iel, s2, diff, nhat, nmag, fx, fy, etc.) throughout
  src/, test/, and examples/
- Initialize allocatable string before first use to suppress
  false-positive -Wmaybe-uninitialized in SELF_Model.f90

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adapt CLAUDE.md from Codex to Claude Code conventions and add a new
section (§9) documenting fprettify-based formatting requirements drawn
from CONTRIBUTING.md, including manual commands and pre-commit setup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

fluidnumerics-joe and others added 3 commits March 9, 2026 18:17
Remove unused variables (fileId, WORKSPACE, s2, bcid) from test files
and eliminate allocatable str in ReportEntropy_Model to fix
-Wunused-variable and -Wmaybe-uninitialized warnings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@fluidnumerics-joe fluidnumerics-joe merged commit 0789a2a into main Mar 10, 2026
10 checks passed
@fluidnumerics-joe fluidnumerics-joe deleted the cleanup-warnings branch March 10, 2026 00:47
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.

1 participant