The default bug view has changed. See this FAQ.

Fix warning about uninitialized variable in DefineIDBInterfaceConstants()

RESOLVED FIXED in Firefox 17

Status

()

Core
DOM: IndexedDB
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: cpeterson, Assigned: cpeterson)

Tracking

Trunk
mozilla17
ARM
Android
Points:
---

Firefox Tracking Flags

(firefox14 affected, firefox15 affected, firefox16 affected, firefox17 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Created attachment 645610 [details] [diff] [review]
fix-uninitialized-interface-warning.patch

mozilla/central/dom/base/nsDOMClassInfo.cpp: In function 'nsresult DefineIDBInterfaceConstants(JSContext*, JSObject*, const nsIID*)':
mozilla/central/dom/base/nsDOMClassInfo.cpp:6013: warning: 'interface' may be used uninitialized in this function
Attachment #645610 - Flags: review?(jonas)
Does that actually fix the warning?  Is GCC smart enough to realize that MOZ_NOT_REACHED doesn't return?  What about in opt builds?
(Assignee)

Comment 2

5 years ago
This patch fixes the warning for my local --enable-optimize build.

MOZ_NOT_REACHED is not a nop in opt builds. It calls __builtin_unreachable() or abort(), depending on your compiler.
Status: NEW → ASSIGNED
Ah, it's different than NS_NOTREACHED then.

/me grumbles about having all these different things.
Comment on attachment 645610 [details] [diff] [review]
fix-uninitialized-interface-warning.patch

Review of attachment 645610 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/base/nsDOMClassInfo.cpp
@@ +6005,5 @@
>      interface = IDBConstant::IDBRequest;
>    }
>    else if (aIID->Equals(NS_GET_IID(nsIIDBTransaction))) {
>      interface = IDBConstant::IDBTransaction;
> +  } else {

}
else {
Attachment #645610 - Flags: review?(jonas) → review+
(Assignee)

Comment 5

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/6ff0749529a6
status-firefox17: affected → fixed
Target Milestone: --- → mozilla17
https://hg.mozilla.org/mozilla-central/rev/6ff0749529a6
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.