From d41239d42500530eb43d458ec2ecceea22163597 Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 23 Aug 2022 13:09:56 +0200 Subject: [PATCH] Now the return value discarded warning is disabled by default in gdscript and cscript. --- modules/cscript/cscript.cpp | 2 +- modules/gdscript/gdscript.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/cscript/cscript.cpp b/modules/cscript/cscript.cpp index f22a2e9f1..aa05b1929 100644 --- a/modules/cscript/cscript.cpp +++ b/modules/cscript/cscript.cpp @@ -2063,7 +2063,7 @@ CScriptLanguage::CScriptLanguage() { GLOBAL_DEF("debug/cscript/completion/autocomplete_setters_and_getters", false); for (int i = 0; i < (int)CScriptWarning::WARNING_MAX; i++) { String warning = CScriptWarning::get_name_from_code((CScriptWarning::Code)i).to_lower(); - bool default_enabled = !warning.begins_with("unsafe_") && i != CScriptWarning::UNUSED_CLASS_VARIABLE; + bool default_enabled = !warning.begins_with("unsafe_") && i != CScriptWarning::UNUSED_CLASS_VARIABLE && i != CScriptWarning::RETURN_VALUE_DISCARDED; GLOBAL_DEF("debug/cscript/warnings/" + warning, default_enabled); } #endif // DEBUG_ENABLED diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 71ce121cd..59376bfda 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -2090,7 +2090,7 @@ GDScriptLanguage::GDScriptLanguage() { GLOBAL_DEF("debug/gdscript/completion/autocomplete_setters_and_getters", false); for (int i = 0; i < (int)GDScriptWarning::WARNING_MAX; i++) { String warning = GDScriptWarning::get_name_from_code((GDScriptWarning::Code)i).to_lower(); - bool default_enabled = !warning.begins_with("unsafe_") && i != GDScriptWarning::UNUSED_CLASS_VARIABLE; + bool default_enabled = !warning.begins_with("unsafe_") && i != GDScriptWarning::UNUSED_CLASS_VARIABLE && i != GDScriptWarning::RETURN_VALUE_DISCARDED; GLOBAL_DEF("debug/gdscript/warnings/" + warning, default_enabled); } #endif // DEBUG_ENABLED