From d699b617acb7f525294c531aa5ef48781cd5adf4 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Tue, 11 Jan 2022 11:56:49 +0100 Subject: Avoiding CodeQL warning. Changed a statement emitted by Fluid to avoid 'unused' warnings: if(w){} into (void)w; to avoid triggering 'Bad error checking' warnings. --- fluid/Fl_Widget_Type.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx index 80537bb0f..68fb64b38 100644 --- a/fluid/Fl_Widget_Type.cxx +++ b/fluid/Fl_Widget_Type.cxx @@ -2200,7 +2200,9 @@ void Fl_Widget_Type::write_code1() { indentation++; - if (wused) write_c("%sw = o; if (w) {/* empty */}\n", indent()); + // Avoid compiler warning for unused variable. + // Also avoid quality control warnings about incorrect allocation error handling. + if (wused) write_c("%sw = o; (void)w;\n", indent()); write_widget_code(); } -- cgit v1.2.3