-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[h2root] Adapt to GCC 8 passing convention for string length #20535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
pcanal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
|
Thanks a lot for this! to see if it's now good or if there are still issues somewhere? As well as locally add: |
|
Ok! I'll try in a separate PR after this one is merged, so we can see what happens |
|
Just tried your changes locally on Ubuntu 22, with sanitizer enabled, and I still get: but I guess that's an unrelated issue. |
ferdymercury
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe "mac14-fortran=OFF" line could be removed now from the CI-config-file.
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: