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

Fix invalid conversion in src/common/unicode_util.cpp #7679

Open
wants to merge 1 commit into
base: B3_0_Release
Choose a base branch
from

Conversation

th1722
Copy link
Contributor

@th1722 th1722 commented Jul 16, 2023

I found this error when I built Firebird as part of LibreOffice.

[...]

workdir/UnpackedTarball/firebird/src/common/unicode_util.cpp:1381:48:
error: invalid conversion from 'UChar* {aka char16_t*}' to
'const short unsigned int*' [-fpermissive]
const Array str(strChars, prefixLen);
^
[...]

Use the reinterpret_cast operator to avoid this error.

@aafemt
Copy link
Contributor

aafemt commented Jul 16, 2023

UChar declared as char16_t? It is not what Firebird sources could expect.

@th1722 th1722 changed the title Fix invalid conversion in src/unicode_util.cpp Fix invalid conversion in src/common/unicode_util.cpp Jul 16, 2023
I found this error when I built Firebird as part of LibreOffice.

[...]
> workdir/UnpackedTarball/firebird/src/common/unicode_util.cpp:1381:48:
> error: invalid conversion from 'UChar* {aka char16_t*}' to
> 'const short unsigned int*' [-fpermissive]
>      const Array<USHORT> str(strChars, prefixLen);
>                                                 ^
[...]

Use the reinterpret_cast operator to avoid this error.
@th1722
Copy link
Contributor Author

th1722 commented Jul 17, 2023

UChar declared as char16_t? It is not what Firebird sources could expect.

No, UChar is declared as unsigned char in LibreOffice.

@aafemt
Copy link
Contributor

aafemt commented Jul 17, 2023

Quoted error text has different opinion.

@AlexPeshkoff
Copy link
Member

AlexPeshkoff commented Jul 31, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants