[h2root] Adapt to GCC 8 passing convention for string length#20535
Merged
guitargeek merged 1 commit intoroot-project:masterfrom Nov 26, 2025
Merged
[h2root] Adapt to GCC 8 passing convention for string length#20535guitargeek merged 1 commit intoroot-project:masterfrom
guitargeek merged 1 commit intoroot-project:masterfrom
Conversation
According to the `gfortran` argument passing conventions, for any Fortran procedure, the compiler will automatically define a C prototype. This is what we use in `h2root`. Note that for procedures like `HROPEN` that takes string arguments, the signature of the C prototype will have extra arguments for the string lengths, which we also have to include in our forward declaration and usage. However, the type of these was changed with GCC 8 to size_t, so we have to also account for that as recommended in [1]. Otherwise, we get undefined behavor, which causes the `h2root` test to fail on ARM64 with GCC 14. [1] https://gcc.gnu.org/onlinedocs/gfortran/Argument-passing-conventions.html
Collaborator
|
Thanks a lot for this! to see if it's now good or if there are still issues somewhere? As well as locally add: |
Contributor
Author
|
Ok! I'll try in a separate PR after this one is merged, so we can see what happens |
Collaborator
|
Just tried your changes locally on Ubuntu 22, with sanitizer enabled, and I still get: but I guess that's an unrelated issue. |
ferdymercury
approved these changes
Nov 26, 2025
Collaborator
ferdymercury
left a comment
There was a problem hiding this comment.
Maybe "mac14-fortran=OFF" line could be removed now from the CI-config-file.
ferdymercury
added a commit
to ferdymercury/root
that referenced
this pull request
Nov 26, 2025
guitargeek
pushed a commit
that referenced
this pull request
Nov 26, 2025
guitargeek
pushed a commit
to guitargeek/root
that referenced
this pull request
Nov 27, 2025
guitargeek
pushed a commit
that referenced
this pull request
Nov 28, 2025
KoljaFrahm
pushed a commit
to KoljaFrahm/root
that referenced
this pull request
Nov 29, 2025
guitargeek
pushed a commit
to guitargeek/root
that referenced
this pull request
Jan 25, 2026
Follow-up of root-project#20535 (cherry picked from commit 4ac2999)
guitargeek
pushed a commit
to guitargeek/root
that referenced
this pull request
Jan 25, 2026
Follow-up of root-project#20535 (cherry picked from commit 4ac2999) (cherry picked from commit d2a8c79)
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.
According to the
gfortranargument passing conventions, for any Fortran procedure, the compiler will automatically define a C prototype. This is what we use inh2root.Note that for procedures like
HROPENthat takes string arguments, the signature of the C prototype will have extra arguments for the string lengths, which we also have to include in our forward declaration and usage. However, the type of these was changed with GCC 8 to size_t, so we have to also account for that as recommended in [1]. Otherwise, we get undefined behavor, which causes theh2roottest to fail on ARM64 with GCC 14.[1] https://gcc.gnu.org/onlinedocs/gfortran/Argument-passing-conventions.html
See also this PR that tests this commit on Alma 10 ARM, with GCC 14: