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

[Clang] Use of deprecated builtins #1210

Closed
adamscott opened this issue Aug 15, 2023 · 0 comments · Fixed by #1211
Closed

[Clang] Use of deprecated builtins #1210

adamscott opened this issue Aug 15, 2023 · 0 comments · Fixed by #1211
Labels
bug This has been identified as a bug
Milestone

Comments

@adamscott
Copy link
Member

adamscott commented Aug 15, 2023

Godot version

n/a

godot-cpp version

df55005

System information

Fedora Workstation 38 - Godot 4.1.beta3 - Vulkan (Forward+)

Issue description

Clang complains about the use of deprecated builtins and suggests replacements.

/home/adamscott/dev/builds/godot-cpp/include/godot_cpp/templates/cowdata.hpp:215:7: warning: builtin __has_trivial_destructor is deprecated; use __is_trivially_destructible instead [-Wdeprecated-builtins]
        if (!__has_trivial_destructor(T)) {
             ^
/home/adamscott/dev/builds/godot-cpp/include/godot_cpp/templates/cowdata.hpp:250:7: warning: builtin __has_trivial_copy is deprecated; use __is_trivially_copyable instead [-Wdeprecated-builtins]
                if (__has_trivial_copy(T)) {
                    ^
/home/adamscott/dev/builds/godot-cpp/include/godot_cpp/templates/cowdata.hpp:313:8: warning: builtin __has_trivial_constructor is deprecated; use __is_trivially_constructible instead [-Wdeprecated-builtins]
                if (!__has_trivial_constructor(T)) {
                     ^
/home/adamscott/dev/builds/godot-cpp/include/godot_cpp/templates/cowdata.hpp:324:8: warning: builtin __has_trivial_destructor is deprecated; use __is_trivially_destructible instead [-Wdeprecated-builtins]
                if (!__has_trivial_destructor(T)) {
                     ^
/home/adamscott/dev/builds/godot-cpp/include/godot_cpp/templates/cowdata.hpp:215:7: warning: builtin __has_trivial_destructor is deprecated; use __is_trivially_destructible instead [-Wdeprecated-builtins]
        if (!__has_trivial_destructor(T)) {
             ^
/home/adamscott/dev/builds/godot-cpp/include/godot_cpp/templates/cowdata.hpp:389:2: note: in instantiation of member function 'godot::CowData<char>::_unref' requested here
        _unref(_ptr);
        ^
/home/adamscott/dev/builds/godot-cpp/include/godot_cpp/variant/char_string.hpp:84:7: note: in instantiation of member function 'godot::CowData<char>::~CowData' requested here
class CharStringT {
      ^
5 warnings generated.

This seems to be related to different behavior between Clang and GCC for the "deprecated" builtins. See https://stackoverflow.com/questions/12754886/has-trivial-copy-behaves-differently-in-clang-and-gcc-whos-right

Steps to reproduce

Build the master branch with Clang as compiler.

Minimal reproduction project

n/a

@adamscott adamscott added the bug This has been identified as a bug label Aug 15, 2023
@adamscott adamscott added this to the 4.2 milestone Aug 15, 2023
@adamscott adamscott changed the title Use of deprecated builtins [Clang] Use of deprecated builtins Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This has been identified as a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant