Now the return value discarded warning is disabled by default in gdscript and cscript.

This commit is contained in:
Relintai 2022-08-23 13:09:56 +02:00
parent a1974c8338
commit d41239d425
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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