ModelicaStandardLibrary icon indicating copy to clipboard operation
ModelicaStandardLibrary copied to clipboard

Add ModelicaDuplicateString and ModelicaDuplicateStringWithErrorReturn of Modelica Language Specification version 3.5

Open beutlich opened this issue 4 years ago • 2 comments

Can only be merged once MSL is based on MLS 3.5.

beutlich avatar Dec 13 '20 18:12 beutlich

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.

beutlich avatar Dec 13 '20 21:12 beutlich

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.

henrikt-ma avatar Dec 13 '20 21:12 henrikt-ma

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?

HansOlsson avatar Dec 11 '23 15:12 HansOlsson

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?

beutlich avatar Dec 11 '23 18:12 beutlich

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.

henrikt-ma avatar Dec 12 '23 07:12 henrikt-ma

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.

dietmarw avatar Dec 13 '23 06:12 dietmarw

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.

maltelenz avatar Dec 13 '23 08:12 maltelenz

Looks good to me, assuming you looked at all occurrences of ModelicaAllocateString and ModelicaAllocateStringWithErrorReturn 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.

beutlich avatar Jan 15 '24 19:01 beutlich

Not that it matters a whole lot, but I think it would be possible to call ModelicaError (which ends with assert(0) anyways) as promised in case of error.

Thanks. All done. Please cross-check again!

beutlich avatar Jan 16 '24 22:01 beutlich