[Bug 1034922] New: libyui-ncurses fails to build with new ncurses
http://bugzilla.suse.com/show_bug.cgi?id=1034922 Bug ID: 1034922 Summary: libyui-ncurses fails to build with new ncurses Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: YaST2 Assignee: yast2-maintainers@suse.de Reporter: mlin@suse.com QA Contact: jsrain@suse.com CC: werner@suse.com Found By: --- Blocker: --- libyui-ncurses fails to build[1] with ncurses update[2] [ 40s] [ 37%] Building CXX object src/CMakeFiles/yui-ncurses.dir/NCDialog.cc.o [ 41s] /home/abuild/rpmbuild/BUILD/libyui-ncurses-2.48.0/src/NCTextPad.cc: In member function 'bool NCTextPad::insert(wint_t)': [ 41s] /home/abuild/rpmbuild/BUILD/libyui-ncurses-2.48.0/src/NCTextPad.cc:381:13: error: 'color' may be used uninitialized in this function [-Werror=maybe-uninitialized] [ 41s] setcchar( &cchar, wch, attr, color, NULL ); [ 41s] ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 41s] /home/abuild/rpmbuild/BUILD/libyui-ncurses-2.48.0/src/NCTextPad.cc:381:47: error: 'attr' may be used uninitialized in this function [-Werror=maybe-uninitialized] [ 41s] setcchar( &cchar, wch, attr, color, NULL ); [ 41s] ^ [ 41s] /home/abuild/rpmbuild/BUILD/libyui-ncurses-2.48.0/src/NCTextPad.cc: In member function 'void NCTextPad::setText(const NCtext&)': [ 41s] /home/abuild/rpmbuild/BUILD/libyui-ncurses-2.48.0/src/NCTextPad.cc:493:15: error: 'color' may be used uninitialized in this function [-Werror=maybe-uninitialized] [ 41s] short int color; [ 41s] ^~~~~ [ 41s] /home/abuild/rpmbuild/BUILD/libyui-ncurses-2.48.0/src/NCTextPad.cc:520:48: error: 'attr' may be used uninitialized in this function [-Werror=maybe-uninitialized] [ 41s] setcchar( &cchar, wch, attr, color, NULL ); [ 41s] ^ [ 41s] [ 38%] Building CXX object src/CMakeFiles/yui-ncurses.dir/NCEmpty.cc.o [ 41s] [ 40%] Building CXX object src/CMakeFiles/yui-ncurses.dir/NCSpacing.cc.o [ 41s] cc1plus: all warnings being treated as errors [1] https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:B... [2] https://build.opensuse.org/request/show/487834 -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1034922
http://bugzilla.suse.com/show_bug.cgi?id=1034922#c1
--- Comment #1 from Dr. Werner Fink
From changelog/NEWS
20170401 [...] + modify set_curterm() to update ttytype[] data used by longname(). + modify wattr_set() and wattr_get() to return ERR if win-parameter is null, as documented. + improve cast used for null-pointer checks in header macros, to reduce compiler warnings. + modify several functions, using the reserved "opts" parameter to pass color- and pair-values larger than 16-bits: + getcchar(), setcchar(), slk_attr_set(), vid_puts(), wattr_get(), wattr_set(), wchgat(), wcolor_set(). + Other functions call these with the corresponding altered behavior, including chgat(), mvchgat(), mvwchgat(), slk_color_on(), slk_color_off(), vid_attr(). [...] And now compare with libyui-ncurses-2.48.0/src/NCTextPad.cc lines 351-397 [...] bool NCTextPad::insert( wint_t key ) { if ( key == 10 ) { return openLine(); } if ( key < 32 || ( key >= 127 && key < 160 ) || UCHAR_MAX < key ) { return false; } assertWidth( ++( *cline ) ); cchar_t cchar; attr_t attr; short int color; wattr_get( w, &attr, &color, NULL ); // NOTE: (w)attr_get is not probided by NCursesWindow wchar_t wch[2]; wch[0] = key; wch[1] = L'\0'; setcchar( &cchar, wch, attr, color, NULL ); // libncurses6 enables ext_color from struct cchar_t (see curses.h). // Set ext_color to 0 to respect the settings got from attr_get (bnc#652240). #ifdef NCURSES_EXT_COLORS cchar.ext_color = 0; #endif ins_wch( curs.L, curs.C++, &cchar ); return true; } ... AFAICS there is no check if wattr_get() might fail -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1034922
http://bugzilla.suse.com/show_bug.cgi?id=1034922#c2
--- Comment #2 from Dr. Werner Fink
http://bugzilla.suse.com/show_bug.cgi?id=1034922
http://bugzilla.suse.com/show_bug.cgi?id=1034922#c3
--- Comment #3 from Stefan Hundhammer
http://bugzilla.suse.com/show_bug.cgi?id=1034922
http://bugzilla.suse.com/show_bug.cgi?id=1034922#c4
Stefan Hundhammer
http://bugzilla.suse.com/show_bug.cgi?id=1034922
http://bugzilla.suse.com/show_bug.cgi?id=1034922#c5
--- Comment #5 from Dr. Werner Fink
http://bugzilla.suse.com/show_bug.cgi?id=1034922
http://bugzilla.suse.com/show_bug.cgi?id=1034922#c6
Steffen Winterfeldt
participants (1)
-
bugzilla_noreply@novell.com