ModelicaStandardLibrary
ModelicaStandardLibrary copied to clipboard
Add ModelicaDuplicateString and ModelicaDuplicateStringWithErrorReturn of Modelica Language Specification version 3.5
Can only be merged once MSL is based on MLS 3.5.
By the way, I noticed that the test implementations of the old functions still don't add a null terminator. Is there a plan to also update these (and remove any redundant null termination on the results of these calls)?
You mean ModelicaAllocateString beahves like calloc? I missed that change.
You mean ModelicaAllocateString beahves like calloc? I missed that change.
Not exactly. It allows for detection of uninitialized reads by only zeroing the last byte.
Blocking accidental merge. Need to wait until master is based on MLS 3.5.
This has now been changed (to 3.6 to be specific). @dietmarw can you check again?
Blocking accidental merge. Need to wait until master is based on MLS 3.5.
This has now been changed (to 3.6 to be specific). @dietmarw can you check again?
So, others features than 3.6 annotations are desired, right?
So, others features than 3.6 annotations are desired, right?
Yes. Tool vendors will need to react and bring up a discussion if they think the adoption of a particular new feature (such as these string allocation functions) is too fast.
It would help if there was a formal decision what MSL version would now allow MLS 3.6 features so the milestone of this PR can be set accordingly.
It would help if there was a formal decision what MSL version would now allow MLS 3.6 features so the milestone of this PR can be set accordingly.
There was (at the monthly MAP-Lib meeting on the 14th of November, if I remember the date right). 4.1.0 will allow 3.6 features. As Henrik says, if any tool vendor thinks a specific feature from 3.6 is not ready to be used, they can speak up in the corresponding pull request.
Looks good to me, assuming you looked at all occurrences of
ModelicaAllocateString
andModelicaAllocateStringWithErrorReturn
to find all that should be replaced by the new functions.
I detected somemore occurrences after rebasing, see https://github.com/modelica/ModelicaStandardLibrary/pull/3686/commits/adc1f12e50ee3ed1501937b392314f70cadf8b73.
Not that it matters a whole lot, but I think it would be possible to call
ModelicaError
(which ends withassert(0)
anyways) as promised in case of error.
Thanks. All done. Please cross-check again!