Skip to content

-Wunused-but-set-parameter is only suppressed in Debug #2079

Closed

Description

@ghuser404

Godot version

4.7.2-stable

godot-cpp version

10.0.0-stable

System information

Windows 11

Issue description

The file in question:
include/godot_cpp/core/binder_common.hpp

The issue is that when godot-cpp is built in Release with GCC with -Wunused-but-set-parameter, this parameter is not suppressed and with -Werror it fails to compile. Also, it seems like an inconsistent check, because #pragma push checks DEBUG_ENABLED, but #pragma pop doesn't.

Suggested fix:
Remove #if defined(DEBUG_ENABLED), so the warning suppression applies in Release too.

// GCC raises "parameter 'p_args' set but not used" when P = {},
// it's not clever enough to treat other P values as making this branch valid.
#if defined(DEBUG_ENABLED) && defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#endif

...

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif

Steps to reproduce

Build godot-cpp in Release with -Wunused-but-set-parameter

Minimal reproduction project

N/A

Activity

  1. dsnopek commented on Oct 26, 2026

    @dsnopek
    Collaborator

    Thanks! That makes sense - I threw together PR #2080 to do this

  2. added
    bugThis has been identified as a bug
    on Oct 26, 2026
  3. added this to the 10.x milestone on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis has been identified as a bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions