-
Notifications
You must be signed in to change notification settings - Fork 0
Fix merge conflict errors in f90wrapgen.py #7
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
base: fix/default-i8-segfault
Are you sure you want to change the base?
Fix merge conflict errors in f90wrapgen.py #7
Conversation
'quip_regression' left out as it has it's own workflow
…dles When compiling with -fdefault-integer-8, bare integer becomes 8 bytes. The handle arrays (e.g., this(4)) were declared as integer, meaning 4 x 8 = 32 bytes with -fdefault-integer-8, but sizeof_fortran_t was calculated assuming 4-byte integers (4 x 4 = 16 bytes). This mismatch caused segfaults when using transfer() to convert between pointer types and integer arrays. Fix by using integer(c_int) for all handle arrays, which remains 4 bytes regardless of -fdefault-integer-8. This ensures consistent size between wrapper generation time and runtime. Changes: - transform.py: Set wrapper_type to 'integer(c_int)' for derived type args - f90wrapgen.py: Use integer(c_int) for handle arrays in: - visit_Procedure (derived type arguments) - _write_sc_array_wrapper (this and dummy_this) - _write_array_getset_item (this and item handles) - _write_array_len (this handle) - _write_scalar_wrapper (this and derived type element handles) - Add 'use, intrinsic :: iso_c_binding, only: c_int' where needed Fixes the default_i8 example test.
The errorbinding example was added to the test suite in PR #320 but was missing the required tests.py and tests_pkg.py files, causing CI to fail.
Remove f2py_string_input and issue299_directc_nested_functions from test suite until they are fixed: - f2py_string_input: undefined symbol string_in_array_ (linking issue) - issue299_directc_nested_functions: types.py shadows Python stdlib types module
The merge commit add07a6 introduced bugs when resolving conflicts between the -fdefault-integer-8 fix and the issue #306 fix: 1. Lines 1072, 1208: Restore integer(c_int) for handle arrays in _write_array_getset_item and _write_array_len methods. The merge incorrectly used plain 'integer' which breaks -fdefault-integer-8. 2. Lines 887-888: Remove erroneous dummy_this declaration for module-level arrays. The issue #306 fix removed dummy_this from the subroutine signature but the merge kept the variable declaration, causing compilation errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
You are nearing your monthly Qodo Merge usage quota. For more information, please visit here. PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
|
You are nearing your monthly Qodo Merge usage quota. For more information, please visit here. PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||
add07a6 to
61d88fa
Compare
User description
Summary
Fixes bugs introduced by merge commit
add07a6when resolving conflicts between the-fdefault-integer-8fix and the issue jameskermode#306 fix.Changes
Lines 1072, 1208: Restore
integer(c_int)for handle arrays in_write_array_getset_itemand_write_array_lenmethods. The merge incorrectly used plainintegerwhich breaks-fdefault-integer-8.Lines 887-888: Remove erroneous
dummy_thisdeclaration for module-level arrays. The issue Module-level allocatable arrays fail with dimension mismatch after reallocation jameskermode/f90wrap#306 fix removeddummy_thisfrom the subroutine signature but the merge kept the variable declaration, causing compilation errors.Test plan
make test🤖 Generated with Claude Code
PR Type
Bug fix
Description
Restore
integer(c_int)type for handle arrays in_write_array_getset_itemand_write_array_lenmethodsRemove erroneous
dummy_thisdeclaration for module-level arraysFix merge conflict resolution errors from commit add07a6
Diagram Walkthrough
File Walkthrough
f90wrapgen.py
Fix merge conflict type and declaration errorsf90wrap/f90wrapgen.py
dummy_thisdeclaration for module-level arrays in_write_sc_array_wrappermethod (lines 887-888)integer(c_int)type annotation for handle array parameters in_write_array_getset_itemmethod (line 1072)integer(c_int)type annotation for handle array parameters in_write_array_lenmethod (line 1208)dummy_thisdeclaration per issue Module-level allocatable arrays fail with dimension mismatch after reallocation jameskermode/f90wrap#306