[master] d699b61 - Avoiding CodeQL warning.

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
Previous Message ]Next Message ]

[master] d699b61 - Avoiding CodeQL warning. "Matthias Melcher" 14:17 Jan 11 top right image
commit d699b617acb7f525294c531aa5ef48781cd5adf4
Author:     Matthias Melcher <github@matthiasm.com>
AuthorDate: Tue Jan 11 11:56:49 2022 +0100
Commit:     Matthias Melcher <github@matthiasm.com>
CommitDate: Tue Jan 11 11:56:54 2022 +0100

    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 fluid/Fl_Widget_Type.cxx fluid/Fl_Widget_Type.cxx
index 80537bb..68fb64b 100644
--- fluid/Fl_Widget_Type.cxx
+++ fluid/Fl_Widget_Type.cxx
@@ -2200,7 +2200,9 @@ void Fl_Widget_Type::write_code1() {
-  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());
Direct Link to Message ]
bottom left image   bottom right image
Previous Message ]Next Message ]

Comments are owned by the poster. All other content is copyright 1998-2022 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.