Closed
Bug 1013263
Opened 10 years ago
Closed 10 years ago
Notification::CloseInternal: warning: ‘rv’ may be used uninitialized in this function [-Wmaybe-uninitialized]
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla32
People
(Reporter: froydnj, Assigned: froydnj)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
1.45 KB,
patch
|
mikehenrty
:
review+
|
Details | Diff | Splinter Review |
This warning is completely legitimate: nsresult rv; // Don't bail out if notification storage fails, since we still // want to send the close event through the alert service. nsCOMPtr<nsINotificationStorage> notificationStorage = do_GetService(NS_NOTIFICATION_STORAGE_CONTRACTID); if (notificationStorage) { nsString origin; rv = GetOrigin(GetOwner(), origin); if (NS_SUCCEEDED(rv)) { notificationStorage->Delete(origin, mID); } } nsCOMPtr<nsIAlertsService> alertService = do_GetService(NS_ALERTSERVICE_CONTRACTID); if (alertService) { if (NS_SUCCEEDED(rv)) { // This is the uninitialized use. alertService->CloseAlert(mAlertName, GetPrincipal()); } } The first comment suggests that we want to always send the alert, so I guess we should just delete the NS_SUCCEEDED check?
Assignee | ||
Comment 1•10 years ago
|
||
Given the initial comment about always wanting to send the close event, we shouldn't need the NS_SUCCEEDED check.
Attachment #8425443 -
Flags: review?(mhenretty)
Assignee | ||
Comment 2•10 years ago
|
||
Here, have a version of the patch without a silly typo.
Attachment #8425443 -
Attachment is obsolete: true
Attachment #8425443 -
Flags: review?(mhenretty)
Attachment #8426399 -
Flags: review?(mhenretty)
Comment 3•10 years ago
|
||
Comment on attachment 8426399 [details] [diff] [review] fix -Wmaybe-uninitialized warning in Notification.cpp Review of attachment 8426399 [details] [diff] [review]: ----------------------------------------------------------------- Good catch! Thanks.
Attachment #8426399 -
Flags: review?(mhenretty) → review+
Comment 4•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/1dfe3f782b41
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → nfroyd
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•