Skip to content

NO_SAFE_CAST doesn't fully forbid casting. #1198

@RechieKho

Description

@RechieKho

Godot version

Godot Engine v4.2.dev.custom_build.eb4301b94

godot-cpp version

5834e16

System information

Arch Linux, AMD ATI Radeon Vega Series / Radeon Vega Mobile Series, CPU: AMD Ryzen 3 3200G (4) @ 3.600GHz

Issue description

I am making a GDExtension that runs tensorflow models. It uses IREE to run the models. To compile it, runtime type id need to be turned off (-no-rtti), which means all of the casting is forbidden. In the past, I could just use NO_SAFE_CAST macro to turn off casting. But now in include/godot_cpp/core/object.hpp, there is a dynamic cast at line 153 and line 166.

I'm not sure whether NO_SAFE_CAST means turning off some of the cast or absolutely no cast. I do hope there is a macro to completely turn off casting.

Steps to reproduce

Compile godot-cpp with NO_SAFE_FLAG defined and -fno-rtti flag.

Minimal reproduction project

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions