Closed Bug 468781 Opened 16 years ago Closed 16 years ago

gcc complaing about comparing char* with string literal

Categories

(Core :: DOM: Events, defect)

1.9.1 Branch
x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: wolfiR, Assigned: wolfiR)

References

(Blocks 1 open bug)

Details

(Keywords: fixed1.9.1)

Attachments

(1 file, 1 obsolete file)

Attached patch possible patch (obsolete) — Splinter Review
http://mxr.mozilla.org/mozilla-central/source/content/events/src/nsDOMDataTransfer.cpp#721

706   const char* formats[] = { kFileMime, kHTMLMime, kURLMime, kURLDataMime, kUnicodeMime };

721         if (formats[f] == kUnicodeMime) {
722           SetDataWithPrincipal(NS_LITERAL_STRING("text/plain"), nsnull, c, sysPrincipal);
723         }
724         else {
725           if (formats[f] == kURLDataMime)

gcc doesn't like that and openSUSE's public buildsystem breaks the complete build because that type of warning is fatal there.
Blocks: buildwarning
Attachment #352278 - Flags: review?(enndeakin)
Attachment #352278 - Flags: review?(enndeakin) → review+
Attachment #352278 - Flags: superreview?(roc)
Attachment #352278 - Flags: approval1.9.1?
Ouch, that is a bad bug.

However, this is also a bad bug:
+          if (strcmp(formats[f], kURLDataMime == 0))

The == 0 should not be inside the second parameter...
Attached patch fixed patchSplinter Review
oO, my original patch is correct, that's what happens if you don't do cut'n'paste. Sorry.
Attachment #352278 - Attachment is obsolete: true
Attachment #352496 - Flags: superreview?(roc)
Attachment #352496 - Flags: review?(roc)
Attachment #352278 - Flags: superreview?(roc)
Attachment #352278 - Flags: approval1.9.1?
Attachment #352496 - Flags: superreview?(roc)
Attachment #352496 - Flags: superreview+
Attachment #352496 - Flags: review?(roc)
Attachment #352496 - Flags: review+
Attachment #352496 - Flags: approval1.9.1?
Pushed to mozilla-central.
Waiting for 1.9.1 approval
Assignee: nobody → mozilla
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Comment on attachment 352496 [details] [diff] [review]
fixed patch

a191=beltzner
Attachment #352496 - Flags: approval1.9.1? → approval1.9.1+
Pushed to 1.9.1
Keywords: fixed1.9.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: