16329, “mppf”, “Should inout or out be allowed for extern or export functions?”, “2020-09-03T15:25:48Z”
Over time, we have migrating the handling of in
, out
, and inout
intents to the call site rather than within the called function. At the same time, I noticed recently that we have some tests using extern proc
with inout
arguments. I’m pretty sure that these are better written using ref
intent but the question here is whether such things should be allowed?
Should an extern proc
be allowed to use inout
or out
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 use inout
or out
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.