Bug 233328 - torcs-1.3.0-17: comparison with string literal
Summary: torcs-1.3.0-17: comparison with string literal
Status: RESOLVED DUPLICATE of bug 233655
Alias: None
Product: openSUSE 10.3
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: unspecified
Hardware: All SUSE Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Stefan Dirsch
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-10 19:31 UTC by David Binderman
Modified: 2007-01-11 15:56 UTC (History)
0 users

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2007-01-10 19:31:09 UTC
I just tried to compile package torcs-1.3.0-17

The compiler said

driverconfig.cpp:584: warning: comparison with string literal

The source code is

    if (curPlayer->transmission != HM_VAL_AUTO) {

but

find ../BUILD/torcs-1.3.0/ -name \*.h -print | xargs fgrep HM_VAL_AUTO
../BUILD/torcs-1.3.0/src/interfaces/playerpref.h:#define HM_VAL_AUTO    "auto"
../BUILD/torcs-1.3.0/export/include/playerpref.h:#define HM_VAL_AUTO    "auto"

I agree with the compiler. Suggest new code

    if (strcmp( curPlayer->transmission, HM_VAL_AUTO) != 0) {
Comment 1 Stefan Dirsch 2007-01-11 10:50:14 UTC
What is the gcc compiler switch to trigger this warning?
Comment 2 David Binderman 2007-01-11 12:10:50 UTC
(In reply to comment #1)
> What is the gcc compiler switch to trigger this warning?

I'm not sure of the individual switch, but I know -Wall
will do it.

Suggest also try "man gcc".

Comment 3 Stefan Dirsch 2007-01-11 15:56:09 UTC

*** This bug has been marked as a duplicate of bug 233655 ***