Skip to content
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

ICU-22356 Revert ICU-21833 change for ures.h #2431

Closed
wants to merge 1 commit into from

Conversation

xry111
Copy link

@xry111 xry111 commented Apr 17, 2023

These usages of UChar are in inline functions for calling C API functions, so they should not be changed to char16_t or the code will fail to compile with -DUCHAR_TYPE=.

Checklist
  • Required: Issue filed: https://unicode-org.atlassian.net/browse/ICU-22356
  • Required: The PR title must be prefixed with a JIRA Issue number.
  • Required: The PR description must include the link to the Jira Issue, for example by completing the URL in the first checklist item
  • Required: Each commit message must be prefixed with a JIRA Issue number.
  • Issue accepted (done by Technical Committee after discussion)
  • Tests included, if applicable
  • API docs and/or User Guide docs changed or added, if applicable

These usages of UChar are in inline functions for calling C API functions, so they should not be changed to char16_t or the code will fail to compile with `-DUCHAR_TYPE=`.
@CLAassistant
Copy link

CLAassistant commented Apr 17, 2023

CLA assistant check
All committers have signed the CLA.

@roubert
Copy link
Member

roubert commented Apr 20, 2023

The code here is explicitly C++ code, which is why I think the solution proposed in PR #2432 is more in line with the original intentions behind ICU-21833.

@xry111
Copy link
Author

xry111 commented Apr 20, 2023

The code here is explicitly C++ code, which is why I think the solution proposed in PR #2432 is more in line with the original intentions behind ICU-21833.

IMO #2432 is an align rule break and leads to undefined behavior. Or am I misunderstanding something here?

@roubert
Copy link
Member

roubert commented Apr 24, 2023

IMO #2432 is an align rule break and leads to undefined behavior.

To ensure that this doesn't become a problem, I updated that PR to instead use the ICU4C helper class ConstChar16Ptr to do the required typecasting in a safe way.

@xry111
Copy link
Author

xry111 commented Apr 25, 2023

Closing as superseded.

@xry111 xry111 closed this Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants