[Bug 226875] New: kpowersave-0.7.1-6: comparison with string literal
https://bugzilla.novell.com/show_bug.cgi?id=226875 Summary: kpowersave-0.7.1-6: comparison with string literal Product: openSUSE 10.3 Version: unspecified Platform: All OS/Version: SuSE Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: dcb314@hotmail.com QAContact: qa@suse.de I just tried to build the package kpowersave-0.7.1-6 I got the following warning message from the compiler. /usr/src/packages/BUILD/kpowersave-0.7.1/src/dbusHAL.cpp:703: warning: comparison with string literal The source code is if (suspend == "Suspend") { Maybe the programmer intended if (strcmp( suspend, "Suspend") == 0) { -- 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, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=226875 mhorvath@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team- |dkukawka@novell.com |screening@forge.provo.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, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=226875 dkukawka@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #1 from dkukawka@novell.com 2006-12-08 10:46 MST ------- Thanks for the report. Fixed in SVN for next YOU update ... follow bug #225212 which should trigger the YOU update -- 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, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=226875 ------- Comment #2 from seife@novell.com 2006-12-08 11:42 MST ------- but isn't this valid C++? we explicitly switched away from these ugly C-isms some time ago :-) -- 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, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=226875 ------- Comment #3 from dcb314@hotmail.com 2006-12-08 12:06 MST -------
but isn't this valid C++?
Valid yes, useful no.
we explicitly switched away from these ugly C-isms some time ago :-)
The programmer appears to have made the assumption that the text literal would be promoted to a C++ string type. The compiler indicates with a warning that the assumption is not valid. It appears to me to be yet another case where compiling with -Wall and reviewing the warning messages produced helps reduce the number of bugs. Compile time bugs are a lot easier to find than run time bugs ;-> -- 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, or are watching someone who is.
participants (1)
-
bugzilla_noreply@novell.com