[Bug 229369] New: yzis-0.0.M3-46: comparison with string literal
https://bugzilla.novell.com/show_bug.cgi?id=229369 Summary: yzis-0.0.M3-46: comparison with string literal Product: openSUSE 10.3 Version: unspecified Platform: All OS/Version: SuSE Linux 10.1 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 compile package yzis-0.0.M3-46 The compiler said mode.cpp:95: warning: comparison with string literal The source code is if ( VERSION_CHAR_ST == VERSION_CHAR_STATE2 ) but linux:/usr/src/packages/SPECS # find ../BUILD/yzis-M3/ -name \*.h -print | xargs fgrep VERSION_CHAR_ST ./BUILD/yzis-M3/libyzis/yzis.h:#define VERSION_CHAR_STATE1 "(stable release)" ./BUILD/yzis-M3/libyzis/yzis.h:#define VERSION_CHAR_STATE2 "(development release - Use for testing only)" ./BUILD/yzis-M3/libyzis/yzis.h:#define VERSION_CHAR_STATE3 "(preview release - Use for testing only)" ./BUILD/yzis-M3/libyzis/yzis.h:#define VERSION_CHAR_ST VERSION_CHAR_STATE3 linux:/usr/src/packages/SPECS # Suggest new code if ( strcmp( VERSION_CHAR_ST, VERSION_CHAR_STATE2) == 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=229369 chrubis@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team- |kde-maintainers@suse.de |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=229369 dmueller@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID ------- Comment #1 from dmueller@novell.com 2007-01-08 01:43 MST ------- both are string literals, the code is valid. strcmp() could be added but would just waste performance. -- 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=229369 dcb314@hotmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|INVALID | ------- Comment #2 from dcb314@hotmail.com 2007-01-08 02:39 MST ------- (In reply to comment #1)
both are string literals, the code is valid.
I would be grateful if you give me a little more detail on why this is valid. IIRC, ISO C says distinct strings are stored at different addresses. It makes no such guarantee for identical strings., merely saying undefined.
strcmp() could be added but would just waste performance.
Is this a performance critical section ? -- 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=229369 ------- Comment #3 from sndirsch@novell.com 2007-01-16 15:30 MST ------- Feel free to close as duplicate of Bug #233655. -- 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=229369 dmueller@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |DUPLICATE ------- Comment #4 from dmueller@novell.com 2007-01-18 06:57 MST ------- David: it seems you're right. I was thinking it is implementation defined. *** This bug has been marked as a duplicate of bug 233655 *** -- 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