Skip to content

Conversation

@beutlich
Copy link
Member

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

@beutlich beutlich added enhancement New feature or enhancement L: C-Sources Issue addresses Modelica/Resources/C-Sources labels Dec 13, 2020
@beutlich beutlich force-pushed the add-str-duplicate branch 2 times, most recently from 78607f6 to b4772b7 Compare December 13, 2020 18:59
Copy link
Contributor

@henrikt-ma henrikt-ma left a 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, assuming you looked at all occurrences of ModelicaAllocateString and ModelicaAllocateStringWithErrorReturn to find all that should be replaced by the new functions.

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)?

@beutlich
Copy link
Member Author

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.

@henrikt-ma
Copy link
Contributor

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.

Copy link
Member

@dietmarw dietmarw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking accidental merge. Need to wait until master is based on MLS 3.56.

@beutlich beutlich added the requires Modelica 3.5 Issue that requires Modelica Language Specification 3.5 label Mar 20, 2023
@HansOlsson
Copy link
Contributor

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?

@beutlich
Copy link
Member Author

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?

@henrikt-ma
Copy link
Contributor

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.

@dietmarw dietmarw changed the title Add ModelicaDuplicateString and ModelicaDuplicateStringWithErrorReturn of Modelica Language Specification version 3.5 Add ModelicaDuplicateString and ModelicaDuplicateStringWithErrorReturn of Modelica Language Specification version 3.6 Dec 13, 2023
@dietmarw
Copy link
Member

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.

@maltelenz
Copy link
Contributor

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 maltelenz added this to the MSL4.1.0 milestone Dec 13, 2023
@HansOlsson HansOlsson dismissed dietmarw’s stale review January 15, 2024 12:43

The review from 2021 predates the decision to base the next release of MSL on Modelica 3.6; thus it is no longer relevant.

@HansOlsson HansOlsson self-requested a review January 15, 2024 12:45
Copy link
Contributor

@HansOlsson HansOlsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@beutlich beutlich changed the title Add ModelicaDuplicateString and ModelicaDuplicateStringWithErrorReturn of Modelica Language Specification version 3.6 Add ModelicaDuplicateString and ModelicaDuplicateStringWithErrorReturn of Modelica Language Specification version 3.5 Jan 15, 2024
@beutlich
Copy link
Member Author

beutlich commented Jan 15, 2024

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 adc1f12.

@beutlich beutlich changed the title Add ModelicaDuplicateString and ModelicaDuplicateStringWithErrorReturn of Modelica Language Specification version 3.5 Add ModelicaDuplicateString and ModelicaDuplicateStringWithErrorReturn (new in Modelica Language Specification version 3.5) Jan 15, 2024
beutlich and others added 2 commits January 16, 2024 23:13
Co-authored-by: Henrik Tidefelt <[email protected]>
Co-authored-by: Henrik Tidefelt <[email protected]>
Copy link
Contributor

@henrikt-ma henrikt-ma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@beutlich beutlich requested a review from henrikt-ma January 16, 2024 22:21
@beutlich
Copy link
Member Author

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!

Copy link
Contributor

@henrikt-ma henrikt-ma left a 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.

@casella casella merged commit da81bb7 into modelica:master Jan 17, 2024
@beutlich beutlich deleted the add-str-duplicate branch January 17, 2024 05:30
@beutlich beutlich removed the request for review from HansOlsson January 17, 2024 05:30
@beutlich beutlich changed the title Add ModelicaDuplicateString and ModelicaDuplicateStringWithErrorReturn (new in Modelica Language Specification version 3.5) Add ModelicaDuplicateString and ModelicaDuplicateStringWithErrorReturn (introduced in Modelica 3.5) Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or enhancement L: C-Sources Issue addresses Modelica/Resources/C-Sources requires Modelica 3.5 Issue that requires Modelica Language Specification 3.5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants