[Bug 432592] New: libtwin0-0.0.3-23: ordered comparison of pointer with integer zero
https://bugzilla.novell.com/show_bug.cgi?id=432592 Summary: libtwin0-0.0.3-23: ordered comparison of pointer with integer zero Product: openSUSE 11.1 Version: Factory Platform: All OS/Version: openSUSE 11.0 Status: NEW Severity: Normal Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: dcb314@hotmail.com QAContact: qa@suse.de Found By: --- I just tried to compile Suse Linux package libtwin0-0.0.3-23 and the compiler said libtwin/twin_cursor.c:184: warning: ordered comparison of pointer with integer zero The source code is fd = cursor_open(file); if (fd < 0) return NULL; Suggest replace with fd = cursor_open(file); if (fd == 0) return NULL; -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=432592 Marcus Meissner <meissner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team-screening@forge.provo.novell.com |sassmann@novell.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=432592 Stefan Assmann <sassmann@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=432592 User sassmann@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=432592#c1 Stefan Assmann <sassmann@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO Info Provider| |dcb314@hotmail.com --- Comment #1 from Stefan Assmann <sassmann@novell.com> 2008-10-07 01:32:15 MDT --- (In reply to comment #0 from David Binderman)
Suggest replace with
fd = cursor_open(file); if (fd == 0) return NULL;
This is not entirely correct. cursor_open can be expanded to either open() or gzopen() depending on the presence of zlib. open() returns -1 on failure while gzopen returns Z_NULL. I don't see this warning, could you provide the whole gcc call with compiler flags? I guess you compiled with "-pedantic". -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=432592 User dcb314@hotmail.com added comment https://bugzilla.novell.com/show_bug.cgi?id=432592#c2 David Binderman <dcb314@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED Info Provider|dcb314@hotmail.com | --- Comment #2 from David Binderman <dcb314@hotmail.com> 2008-10-13 05:15:15 MDT --- (In reply to comment #1 from Stefan Assmann)
I don't see this warning, could you provide the whole gcc call with compiler flags?
Tricky - I've got my own home brew version of the GNU gcc compiler which does some special magic.
I guess you compiled with "-pedantic".
Nope, but switching on "-Wall -Wextra -O3" will probably get what you need. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=432592 User stefan.fent@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=432592#c5 --- Comment #5 from Stefan Fent <stefan.fent@novell.com> 2009-03-06 08:39:31 MST --- This looks like a solution to me: --- libtwin0-0.0.3.orig/libtwin/twin_cursor.c +++ libtwin0-0.0.3/libtwin/twin_cursor.c @@ -181,8 +181,14 @@ twin_pixmap_t *twin_load_X_cursor(const twin_pixmap_t *cur = NULL; fd = cursor_open(file); + +#ifdef HAVE_ZLIB + if (fd == NULL) +#else if (fd < 0) +#endif return NULL; + if (!twin_read_header(fd, buffer, XCURSOR_FILE_HEADER_LEN)) goto bail; -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=432592 User stefan.fent@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=432592#c6 Stefan Fent <stefan.fent@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED --- Comment #6 from Stefan Fent <stefan.fent@novell.com> 2009-03-10 05:22:44 MST --- submitted above patch to STABLE -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com