Skip to content

Fix argument passing conventions in h2root.#21404

Merged
hageboeck merged 1 commit intoroot-project:masterfrom
hageboeck:fix_h2root
Feb 27, 2026
Merged

Fix argument passing conventions in h2root.#21404
hageboeck merged 1 commit intoroot-project:masterfrom
hageboeck:fix_h2root

Conversation

@hageboeck
Copy link
Member

@hageboeck hageboeck commented Feb 27, 2026

When variable-length strings are passed into functions compiled by gfortran, the lengths of the strings have to be passed at the end of the argument list as size_t (since gcc 7). With clang, where the __GNUC__ macro could expand to funny values, we were passing int on the C side, making fortran interpret the string lengths wrongly.

fixes #19329

@hageboeck hageboeck self-assigned this Feb 27, 2026
@dpiparo
Copy link
Member

dpiparo commented Feb 27, 2026

The other piece of info is that on macOS, the __GNUC__ preprocessor variable is set to 4 even for the latest apple clang versions, as well as regulat clang versions on linux, e.g. 19.

When variable-length strings are passed into functions compiled by
gfortran, the lengths of the strings have to be passed at the end of the
argument list as size_t. When using gcc <= 7 or clang (where the
__GNUC__ macro might return unpredictable values), we were putting int on
the C side, which got interpreted as size_t on the fortran side.
@hageboeck hageboeck marked this pull request as ready for review February 27, 2026 10:18
@hageboeck hageboeck requested a review from pcanal as a code owner February 27, 2026 10:18
Copy link
Member

@dpiparo dpiparo left a comment

Choose a reason for hiding this comment

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

it works!

@github-actions
Copy link

Test Results

    22 files      22 suites   3d 6h 36m 56s ⏱️
 3 804 tests  3 801 ✅ 1 💤 2 ❌
75 649 runs  75 638 ✅ 9 💤 2 ❌

For more details on these failures, see this check.

Results for commit 0ad7fc2.

@hageboeck hageboeck merged commit 3a9316e into root-project:master Feb 27, 2026
27 of 30 checks passed
@hageboeck hageboeck deleted the fix_h2root branch February 27, 2026 13:54
@hageboeck
Copy link
Member Author

/backport to 6.38

@root-project-bot
Copy link

This PR has been backported to branch 6.38: #21410

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.

h2root fragilities

4 participants