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 bug any_cast for iOS clang compiler #2907

Closed
wants to merge 1 commit into from
Closed

Fix bug any_cast for iOS clang compiler #2907

wants to merge 1 commit into from

Conversation

HadesD
Copy link
Contributor

@HadesD HadesD commented Aug 4, 2023

iOS clang just only check literal value, it will be failed on some case

iOS clang just only check literal value, it will be failed on some case
#else
(operand->type() == typeid(ValueType))
#endif
((operandTypeInfo == valueTypeInfo) || (std::strcmp(operandTypeInfo.name(), valueTypeInfo.name()) == 0))
Copy link
Member

@paroj paroj Aug 4, 2023

Choose a reason for hiding this comment

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

we certainly dont need both comparisons. We should clearly identify which is needed on which platform.

Also this might be just an issue with your code. I fixed a similar issue in e2d1380

So please also provide an example where the == comparison fails.

also see: https://stackoverflow.com/questions/19496643/using-clang-fvisibility-hidden-and-typeinfo-and-type-erasure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't debug more detail on xcode like android studio (it will jump to std header to compare too, but xcode doesn't)
but when i debug to ValueType and operand has same `char* type_name = "P5WX11ProxyObjectN;", it failed

Copy link
Member

Choose a reason for hiding this comment

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

yes, pointer comparison may fail when the typeinfo is duplicated in different dynlibs. See the stackoverflow thread above.
However, this can be caused by missing dllexport on your ProxyObject and is not necessarily a bug in Ogre.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@paroj no, i'm build for ios on STATIC lib all, so i think it not about dllexport?

Copy link
Member

Choose a reason for hiding this comment

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

this is an even stronger hint that something is off with your build. Ogre uses any_cast internally too, so if those work but your own does not it means you are somehow violating the ODR.

@paroj paroj added the incomplete essential information is missing to reproduce this label Aug 4, 2023
@paroj paroj marked this pull request as draft August 4, 2023 16:20
@paroj
Copy link
Member

paroj commented Dec 23, 2023

superceded by #2988

@paroj paroj closed this Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incomplete essential information is missing to reproduce this
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants