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
Should inout or out be allowed for extern or export functions? #16329
Comments
I created issue chapel-lang#16329 to ask if we should allow inout/out intents for extern/export.
I'm pretty open to not supporting intents for Since export proc foo(in x: int, inout y: int) { ... } I'd imagine we'd have the callable-from Chapel version of To me, if we can pull this off, it seems the most consistent/productive for what I think of |
@bradcray - I think it is worth a try to do as you describe for export - but in the mean time should we disallow these intents until we sort it out? |
If they don't work today, that would be fine with me. |
PR #16334 will explore adding this error for now. |
I created issue chapel-lang#16329 to ask if we should allow inout/out intents for extern/export.
I created issue chapel-lang#16329 to ask if we should allow inout/out intents for extern/export.
Add error for extern/export with out/inout intent For issue #16329. - [x] full local testing Reviewed by @lydia-duncan - thanks!
Over time, we have been migrating the handling of
in
,out
, andinout
intents to the call site rather than within the called function. At the same time, I noticed recently that we have some tests usingextern proc
withinout
arguments. I'm pretty sure that these are better written usingref
intent but the question here is whether such things should be allowed?Should an
extern proc
be allowed to useinout
orout
intent? These are not implemented in C. However they are now handled at the call site, and so the Chapel compiler could copy in such cases.Should a generated C wrapper for
export proc
be allowed to useinout
orout
intent? These are not implemented in C and C code calling such a function can't automatically handle these details at the call site.Anyway I am currently of a mind that we should disallow these cases for now and allow them again over time when we are confident that they are reasonable features and work correctly.
The text was updated successfully, but these errors were encountered: