Fix GNU Debug build of fftpack5.1.f - #3437
Merged
andrew-platt merged 1 commit intoAug 20, 2026
Merged
Conversation
…ment-mismatch) Debug builds with gfortran fail to compile fftpack5.1.f with 64 hard errors: Error: Type mismatch in argument 'dsum' at (1); passed REAL(4) to REAL(8) Error: Type mismatch in argument 'c' at (1); passed REAL(4) to COMPLEX(4) These mismatches are intentional: FFTPACK 5.1 uses legacy Fortran 77 type punning and is deliberately compiled with -fno-default-real-8 while the rest of the build uses -fdefault-real-8, so its callers can pass explicit SiKi/R4Ki arrays. -fallow-argument-mismatch is already applied to downgrade them to warnings. However, Debug builds add -pedantic, which promotes the argument mismatches back to errors and overrides -fallow-argument-mismatch. Appending -Wno-pedantic to this file's compile flags restores the intended behaviour. The suppression is scoped to this single legacy source; Release builds are unaffected as they do not pass -pedantic. Verified on gfortran 12.2.0 with cmake -DDOUBLE_PRECISION=On -DCMAKE_BUILD_TYPE=Debug -DGENERATE_TYPES=On .. Isolation test on the exact compile line: -pedantic -> 64 errors -pedantic -std=legacy -> 64 errors -pedantic -Wno-argument-mismatch -> 64 errors -pedantic -Wno-pedantic -> 0 errors (object builds) Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Scopes a GNU Fortran Debug-build diagnostic suppression to the legacy FFTPACK 5.1 single-file source so that intentional Fortran 77 argument/type punning continues to compile under -pedantic.
Changes:
- Adds
-Wno-pedanticto the per-source compile flags forsrc/NetLib/fftpack/fftpack5.1.fwhen using GNU Fortran. - Documents why this suppression is needed alongside the existing per-file GNU flags (
-fallow-argument-mismatch,-fno-default-real-8,-fno-default-double-8).
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Ready to merge
Feature or improvement description
Debug builds with gfortran fail to compile fftpack5.1.f with 64 hard errors:
These mismatches are intentional: FFTPACK 5.1 uses legacy Fortran 77 type punning and is deliberately compiled with
-fno-default-real-8while the rest of the build uses-fdefault-real-8, so its callers can pass explicitSiKi/R4Kiarrays.-fallow-argument-mismatchis already applied to downgrade them to warnings.However, Debug builds add
-pedantic, which promotes the argument mismatches back to errors and overrides-fallow-argument-mismatch. Appending-Wno-pedanticto this file's compile flags restores the intended behaviour. The suppression is scoped to this single legacy source; Release builds are unaffected as they do not pass -pedantic.Verified on gfortran 12.2.0 (linux) and 15.2.0 (macosx) with
cmake -DDOUBLE_PRECISION=On -DCMAKE_BUILD_TYPE=Debug -DGENERATE_TYPES=On ..Isolation test on the exact compile line:
-pedantic-pedantic -std=legacy-pedantic -Wno-argument-mismatch-pedantic -Wno-pedanticRelated issue, if one exists
Introduced in PR #3412
Impacted areas of the software
Compilation with certain compilers on linux and macosx
Additional supporting information
caught by ai during testing for a new feature.
Generative AI usage
Co-authored-by: GitHub Copilot copilot@github.com
Co-authored-by: Claude Opus 5 noreply@anthropic.com
Test results, if applicable
None affected