Skip to content

Unused variable in wrapped.hpp in free_property_list_bind #1950

Description

@hhyyrylainen

Godot version

4.6.1

godot-cpp version

4.5 (60b5a41)

System information

Linux, gcc (GCC) 15.2.1 20260123 (Red Hat 15.2.1-7)

Issue description

There is an unused variable on line 322 which causes builds to fail when treating warnings as errors. This code is also triggered whenever the class macro is used so even suppressing all warnings from Godot headers is not enough.

Commenting out this line makes building work:

/*m_class *cls = reinterpret_cast<m_class *>(p_instance);*/   

Steps to reproduce

Try to compile any class that uses the GDCLASS macro:

class GameSimulation : public godot::Node
{
    // NOLINTNEXTLINE(modernize-use-auto)
    GDCLASS(GameSimulation, godot::Node)
}

Minimal reproduction project

Any class using the GDCLASS macro should be fine enough, here's one that while it might not link correctly that should not be necessary to see the compile error:

#include <godot_cpp/classes/node.hpp>

namespace Extension
{
class GameSimulation : public godot::Node
{
    // NOLINTNEXTLINE(modernize-use-auto)
    GDCLASS(GameSimulation, godot::Node)

public:
    GameSimulation(){}
    ~GameSimulation() override{}

};

} // namespace Extension

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions