Fix compile error in AT_lambda_Vavilov_FWHM under GCC 16 / C23 - #288
Open
grzanka wants to merge 1 commit into
Open
Fix compile error in AT_lambda_Vavilov_FWHM under GCC 16 / C23#288grzanka wants to merge 1 commit into
grzanka wants to merge 1 commit into
Conversation
… args AT_lambda_Landau_FWHM_left() takes no arguments, but AT_lambda_Vavilov_FWHM called it as AT_lambda_Landau_FWHM_left(kappa, beta). Under C23 (default in GCC 16), an empty parameter list means the function takes no parameters at all, so this call fails to compile with "too many arguments to function". The correct counterpart is AT_lambda_Vavilov_FWHM_left(kappa, beta), which already exists and is used the same way AT_lambda_Vavilov_FWHM_right is. Fixes #287
There was a problem hiding this comment.
Pull request overview
This PR fixes a C23/GCC 16 compile error (and a matching logic bug) in AT_lambda_Vavilov_FWHM by replacing an incorrect call to the zero-argument AT_lambda_Landau_FWHM_left() with the correct two-argument AT_lambda_Vavilov_FWHM_left(kappa, beta).
Changes:
- Corrected
AT_lambda_Vavilov_FWHMto compute the Vavilov FWHM width asright - leftusing Vavilov endpoints. - Eliminated a C23 “too many arguments to function” error by removing arguments from the Landau-left function call (by no longer calling it there).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
AT_lambda_Vavilov_FWHMinsrc/AT_EnergyLoss.ccalledAT_lambda_Landau_FWHM_left(kappa, beta), butAT_lambda_Landau_FWHM_leftis declared and defined with no parameters. Under C17 and earlier, an empty parameter list()in a non-prototype declaration meant "unspecified arguments," so compilers tolerated the extra arguments. C23 (the default standard in GCC 16) changes this:()now means the function takes exactly zero parameters, so the call becomes a hard compile error ("too many arguments to function").The correct counterpart to
AT_lambda_Vavilov_FWHM_right(kappa, beta)isAT_lambda_Vavilov_FWHM_left(kappa, beta), which already exists in the same file and takeskappa/beta— it was simply the wrong function being called.This also fixes a latent logic bug:
AT_lambda_Vavilov_FWHMwas mixing a Vavilov-distribution FWHM-right value with a Landau-distribution FWHM-left value (a constant, independent ofkappa/beta), instead of using the matching Vavilov-distribution left value.Test plan
-std=c2x(C23 semantics), confirming this is the root cause of the GCC 16 failure.src/AT_EnergyLoss.cstandalone withgcc -std=c2xafter the fix — no errors.Fixes #287
Generated by Claude Code