-
Notifications
You must be signed in to change notification settings - Fork 93
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
Closes #2593: Add compat version of c_void_ptr
for new c_ptr(void)
#2594
Closes #2593: Add compat version of c_void_ptr
for new c_ptr(void)
#2594
Conversation
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.
Looks good to me! As @riftEmber said, we should prob try and merge #2589 since this is built on that
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.
I am a bit worried about this moving forward. Typically, the compat for the current version would have nothing in it and then the ones for any older versions would be configured so that the new call returns the old thing. So I would be expecting the gt131 compat to be empty and e-130 and eq-131 to have c_ptr(void)
defined to return the old c_void_ptr
. This is introducing a lot of updates that will need to be made again in the future because c_ptr_void
is not what is used in any Chapel version. I am also a bit concerned with the naming that it will not be an obvious difference to people. Is there a reason we have to do it this way?
@Ethan-DeBandi99 Unfortunately I believe there is no way in Chapel to define There might be a better name than I think the future work created by this is:
I recognize this change in Chapel, which I was responsible for, is relatively abrupt and a nuisance to work around, and I apologize for that. The reason for it is time constraints in needing to complete our potentially-disruptive changes to the |
Hold on, I may have been wrong about not being able to re-declare |
Yah if that's possible, that would be awesome! |
Ok, it is not possible in the way I was hoping. My confusion came from the fact that for a I did come up with another alternative, which makes the gt-131 compat module a little messy/hacky but allows use of // compat/gt-131/ArkoudaCTypesCompat.chpl
module ArkoudaCTypesCompat {
// Use an only clause including everything except the deprecated c_void_ptr,
// so we can define it as an alias for its replacement c_ptr(void).
// Using an except clause would not work here as the reference to the
// deprecated name c_void_ptr would warn.
public use CTypes only c_float, c_double, cFileTypeHasPointer, c_FILE, c_ptr,
c_ptrConst, c_array, c_ptrTo, c_ptrToConst, cPtrToLogicalValue,
c_addrOf, c_addrOfConst, c_sizeof, c_offsetof, allocate, deallocate;
// Need to manually use ChapelSysCTypes here, as it is `public use`d in CTypes
// but doesn't get picked up by the above use with only clause.
public use ChapelSysCTypes;
// Redefine c_void_ptr to a usable form, without deprecation warning.
type c_void_ptr = c_ptr(void);
} This would eliminate future work, except for replacing |
I think either path forward seems reasonable, so I'll defer to @Ethan-DeBandi99 on this one |
@riftEmber - Thank you for providing so much information of this. This is extremely helpful. My personal preference would be to use the existing Again, thank you for looking into this more. |
No problem! I've implemented the |
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.
Looks good! Thanks!
Chapel recently deprecated
c_void_ptr
in favor ofc_ptr(void)
, which will be in the 1.32 release(PR chapel-lang/chapel#22637).
This also included compiler changes to make
c_ptr(void)
possible, which would not previouslycompile. To avoid use of the now-deprecated
c_void_ptr
in versions newer than 1.31, introducea new
c_ptr_void
symbol inArkoudaCTypesCompat
which is
c_void_ptr
for Chapel <=1.31, andc_ptr(void)
for Chapel >1.31.Note this is based off of
#2589 which adds
the new compat dir for 1.32, to avoid conflicts.
This PR should be merged after that one.
Closes #2593