Skip to content

OpenBSD error: conversion from 'const Variant' to 'unsigned long' is ambiguous #74669

@omar-polo

Description

@omar-polo

Godot version

4.0

System information

OpenBSD/amd64 7.2-CURRENT, amdgpu

Issue description

Trying to build on OpenBSD and I'm hitting this error message. Building with -DNEED_LONG_INT seems to go past this, but since it's only used for ios on aarch64 (guessing from grepping where it's defined) I'm not sure; this is happening on amd64 for me.

Here's the full error message; I apologize but my C++-fu is not strong enough to fully grasp this.

In file included from platform/linuxbsd/tts_linux.cpp:31:
In file included from platform/linuxbsd/tts_linux.h:40:
In file included from ./servers/display_server.h:34:
In file included from ./core/input/input.h:34:
In file included from ./core/input/input_event.h:35:
In file included from ./core/io/resource.h:34:
In file included from ./core/io/resource_uid.h:34:
In file included from ./core/object/ref_counted.h:34:
In file included from ./core/object/class_db.h:34:
In file included from ./core/object/method_bind.h:34:
./core/variant/binder_common.h:57:11: error: conversion from 'const Variant' to 'unsigned long' is ambiguous
                        return p_variant;
                               ^~~~~~~~~
./core/variant/binder_common.h:295:44: note: in instantiation of member function 'VariantCaster<unsigned long>::cast' requested here
        (p_instance->*p_method)(VariantCaster<P>::cast(*p_args[Is])...);
                                                  ^
./core/variant/binder_common.h:407:2: note: in instantiation of function template specialization 'call_with_variant_args_helper<TTS_Linux, unsigned long, unsigned long, int, const String &, 0UL, 1UL, 2UL, 3UL>' requested here
        call_with_variant_args_helper<T, P...>(p_instance, p_method, p_args, r_error, BuildIndexSequence<sizeof...(P)>{});
        ^
./core/object/callable_method_pointer.h:104:3: note: in instantiation of function template specialization 'call_with_variant_args<TTS_Linux, unsigned long, unsigned long, int, const String &>' requested here
                call_with_variant_args(data.instance, data.method, p_arguments, p_argcount, r_call_error);
                ^
./core/object/callable_method_pointer.h:107:2: note: in instantiation of member function 'CallableCustomMethodPointer<TTS_Linux, unsigned long, unsigned long, int, const String &>::call' requested here
        CallableCustomMethodPointer(T *p_instance, void (T::*p_method)(P...)) {
        ^
./core/object/callable_method_pointer.h:125:22: note: in instantiation of member function 'CallableCustomMethodPointer<TTS_Linux, unsigned long, unsigned long, int, const String &>::CallableCustomMethodPointer' requested here
        CCMP *ccmp = memnew(CCMP(p_instance, p_method));
                            ^
platform/linuxbsd/tts_linux.cpp:80:3: note: in instantiation of function template specialization 'create_custom_callable_function_pointer<TTS_Linux, unsigned long, unsigned long, int, const String &>' requested here
                callable_mp(tts, &TTS_Linux::_speech_index_mark).call_deferred(p_msg_id, p_client_id, (int)p_type, String::utf8(p_index_mark));
                ^
./core/object/callable_method_pointer.h:245:27: note: expanded from macro 'callable_mp'
#define callable_mp(I, M) create_custom_callable_function_pointer(I, M)
                          ^
./core/variant/variant.h:353:2: note: candidate function
        operator bool() const;
        ^
./core/variant/variant.h:354:2: note: candidate function
        operator signed int() const;
        ^
./core/variant/variant.h:355:2: note: candidate function
        operator unsigned int() const; // this is the real one
        ^
./core/variant/variant.h:356:2: note: candidate function
        operator signed short() const;
        ^
./core/variant/variant.h:357:2: note: candidate function
        operator unsigned short() const;
        ^
./core/variant/variant.h:358:2: note: candidate function
        operator signed char() const;
        ^
./core/variant/variant.h:359:2: note: candidate function
        operator unsigned char() const;
        ^
./core/variant/variant.h:361:2: note: candidate function
        operator int64_t() const;
        ^
./core/variant/variant.h:362:2: note: candidate function
        operator uint64_t() const;
        ^
./core/variant/variant.h:370:2: note: candidate function
        operator char32_t() const;
        ^
./core/variant/variant.h:371:2: note: candidate function
        operator float() const;
        ^
./core/variant/variant.h:372:2: note: candidate function
        operator double() const;
        ^
./core/variant/variant.h:420:2: note: candidate function
        operator Side() const;
        ^
./core/variant/variant.h:421:2: note: candidate function
        operator Orientation() const;
        ^
In file included from platform/linuxbsd/tts_linux.cpp:31:
In file included from platform/linuxbsd/tts_linux.h:40:
In file included from ./servers/display_server.h:34:
In file included from ./core/input/input.h:34:
In file included from ./core/input/input_event.h:35:
In file included from ./core/io/resource.h:34:
In file included from ./core/io/resource_uid.h:34:
In file included from ./core/object/ref_counted.h:34:
In file included from ./core/object/class_db.h:34:
In file included from ./core/object/method_bind.h:34:
In file included from ./core/variant/binder_common.h:35:
In file included from ./core/object/object.h:35:
In file included from ./core/object/message_queue.h:36:
In file included from ./core/variant/variant.h:60:
./core/variant/callable.h:78:43: error: conversion from 'unsigned long' to 'Variant' is ambiguous
                Variant args[sizeof...(p_args) + 1] = { p_args..., 0 }; // +1 makes sure zero sized arrays are also supported.
                                                        ^~~~~~
platform/linuxbsd/tts_linux.cpp:80:52: note: in instantiation of function template specialization 'Callable::call_deferred<unsigned long, unsigned long, int, String>' requested here
                callable_mp(tts, &TTS_Linux::_speech_index_mark).call_deferred(p_msg_id, p_client_id, (int)p_type, String::utf8(p_index_mark));
                                                                 ^
./core/variant/variant.h:428:2: note: candidate constructor
        Variant(bool p_bool);
        ^
./core/variant/variant.h:429:2: note: candidate constructor
        Variant(signed int p_int); // real one
        ^
./core/variant/variant.h:430:2: note: candidate constructor
        Variant(unsigned int p_int);
        ^
./core/variant/variant.h:435:2: note: candidate constructor
        Variant(signed short p_short); // real one
        ^
./core/variant/variant.h:436:2: note: candidate constructor
        Variant(unsigned short p_short);
        ^
./core/variant/variant.h:437:2: note: candidate constructor
        Variant(signed char p_char); // real one
        ^
./core/variant/variant.h:438:2: note: candidate constructor
        Variant(unsigned char p_char);
        ^
./core/variant/variant.h:439:2: note: candidate constructor
        Variant(int64_t p_int); // real one
        ^
./core/variant/variant.h:440:2: note: candidate constructor
        Variant(uint64_t p_int);
        ^
./core/variant/variant.h:441:2: note: candidate constructor
        Variant(float p_float);
        ^
./core/variant/variant.h:442:2: note: candidate constructor
        Variant(double p_double);
        ^
In file included from platform/linuxbsd/tts_linux.cpp:31:
In file included from platform/linuxbsd/tts_linux.h:40:
In file included from ./servers/display_server.h:34:
In file included from ./core/input/input.h:34:
In file included from ./core/input/input_event.h:35:
In file included from ./core/io/resource.h:34:
In file included from ./core/io/resource_uid.h:34:
In file included from ./core/object/ref_counted.h:34:
In file included from ./core/object/class_db.h:34:
In file included from ./core/object/method_bind.h:34:
In file included from ./core/variant/binder_common.h:35:
In file included from ./core/object/object.h:35:
In file included from ./core/object/message_queue.h:36:
In file included from ./core/variant/variant.h:60:
./core/variant/callable.h:78:43: error: conversion from 'unsigned long' to 'Variant' is ambiguous
                Variant args[sizeof...(p_args) + 1] = { p_args..., 0 }; // +1 makes sure zero sized arrays are also supported.
                                                        ^~~~~~
./core/variant/variant.h:428:2: note: candidate constructor
        Variant(bool p_bool);
        ^
./core/variant/variant.h:429:2: note: candidate constructor
        Variant(signed int p_int); // real one
        ^
./core/variant/variant.h:430:2: note: candidate constructor
        Variant(unsigned int p_int);
        ^
./core/variant/variant.h:435:2: note: candidate constructor
        Variant(signed short p_short); // real one
        ^
./core/variant/variant.h:436:2: note: candidate constructor
        Variant(unsigned short p_short);
        ^
./core/variant/variant.h:437:2: note: candidate constructor
        Variant(signed char p_char); // real one
        ^
./core/variant/variant.h:438:2: note: candidate constructor
        Variant(unsigned char p_char);
        ^
./core/variant/variant.h:439:2: note: candidate constructor
        Variant(int64_t p_int); // real one
        ^
./core/variant/variant.h:440:2: note: candidate constructor
        Variant(uint64_t p_int);
        ^
./core/variant/variant.h:441:2: note: candidate constructor
        Variant(float p_float);
        ^
./core/variant/variant.h:442:2: note: candidate constructor
        Variant(double p_double);
        ^
In file included from platform/linuxbsd/tts_linux.cpp:31:
In file included from platform/linuxbsd/tts_linux.h:40:
In file included from ./servers/display_server.h:34:
In file included from ./core/input/input.h:34:
In file included from ./core/input/input_event.h:35:
In file included from ./core/io/resource.h:34:
In file included from ./core/io/resource_uid.h:34:
In file included from ./core/object/ref_counted.h:34:
In file included from ./core/object/class_db.h:34:
In file included from ./core/object/method_bind.h:34:
In file included from ./core/variant/binder_common.h:35:
In file included from ./core/object/object.h:35:
In file included from ./core/object/message_queue.h:36:
In file included from ./core/variant/variant.h:60:
./core/variant/callable.h:78:43: error: conversion from 'unsigned long' to 'Variant' is ambiguous
                Variant args[sizeof...(p_args) + 1] = { p_args..., 0 }; // +1 makes sure zero sized arrays are also supported.
                                                        ^~~~~~
platform/linuxbsd/tts_linux.cpp:95:47: note: in instantiation of function template specialization 'Callable::call_deferred<unsigned long, unsigned long, int>' requested here
                callable_mp(tts, &TTS_Linux::_speech_event).call_deferred(p_msg_id, p_client_id, (int)p_type);
                                                            ^
./core/variant/variant.h:428:2: note: candidate constructor
        Variant(bool p_bool);
        ^
./core/variant/variant.h:429:2: note: candidate constructor
        Variant(signed int p_int); // real one
        ^
./core/variant/variant.h:430:2: note: candidate constructor
        Variant(unsigned int p_int);
        ^
./core/variant/variant.h:435:2: note: candidate constructor
        Variant(signed short p_short); // real one
        ^
./core/variant/variant.h:436:2: note: candidate constructor
        Variant(unsigned short p_short);
        ^
./core/variant/variant.h:437:2: note: candidate constructor
        Variant(signed char p_char); // real one
        ^
./core/variant/variant.h:438:2: note: candidate constructor
        Variant(unsigned char p_char);
        ^
./core/variant/variant.h:439:2: note: candidate constructor
        Variant(int64_t p_int); // real one
        ^
./core/variant/variant.h:440:2: note: candidate constructor
        Variant(uint64_t p_int);
        ^
./core/variant/variant.h:441:2: note: candidate constructor
        Variant(float p_float);
        ^
./core/variant/variant.h:442:2: note: candidate constructor
        Variant(double p_double);
        ^
In file included from platform/linuxbsd/tts_linux.cpp:31:
In file included from platform/linuxbsd/tts_linux.h:40:
In file included from ./servers/display_server.h:34:
In file included from ./core/input/input.h:34:
In file included from ./core/input/input_event.h:35:
In file included from ./core/io/resource.h:34:
In file included from ./core/io/resource_uid.h:34:
In file included from ./core/object/ref_counted.h:34:
In file included from ./core/object/class_db.h:34:
In file included from ./core/object/method_bind.h:34:
In file included from ./core/variant/binder_common.h:35:
In file included from ./core/object/object.h:35:
In file included from ./core/object/message_queue.h:36:
In file included from ./core/variant/variant.h:60:
./core/variant/callable.h:78:43: error: conversion from 'unsigned long' to 'Variant' is ambiguous
                Variant args[sizeof...(p_args) + 1] = { p_args..., 0 }; // +1 makes sure zero sized arrays are also supported.
                                                        ^~~~~~
./core/variant/variant.h:428:2: note: candidate constructor
        Variant(bool p_bool);
        ^
./core/variant/variant.h:429:2: note: candidate constructor
        Variant(signed int p_int); // real one
        ^
./core/variant/variant.h:430:2: note: candidate constructor
        Variant(unsigned int p_int);
        ^
./core/variant/variant.h:435:2: note: candidate constructor
        Variant(signed short p_short); // real one
        ^
./core/variant/variant.h:436:2: note: candidate constructor
        Variant(unsigned short p_short);
        ^
./core/variant/variant.h:437:2: note: candidate constructor
        Variant(signed char p_char); // real one
        ^
./core/variant/variant.h:438:2: note: candidate constructor
        Variant(unsigned char p_char);
        ^
./core/variant/variant.h:439:2: note: candidate constructor
        Variant(int64_t p_int); // real one
        ^
./core/variant/variant.h:440:2: note: candidate constructor
        Variant(uint64_t p_int);
        ^
./core/variant/variant.h:441:2: note: candidate constructor
        Variant(float p_float);
        ^
./core/variant/variant.h:442:2: note: candidate constructor
        Variant(double p_double);
        ^
5 errors generated.

Steps to reproduce

building from the 4.0 release tarball on OpenBSD

Minimal reproduction project

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions