Closed Bug 619639 Opened 14 years ago Closed 14 years ago

ContentParent.cpp build warnings like "warning: ignoring return value of ‘bool mozilla::dom::PContentParent::SendFlushMemory(const nsString&)’, declared with attribute warn_unused_result"

Categories

(Core :: IPC, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: dholbert, Unassigned)

Details

(Whiteboard: [build_warning])

Filing bug on build warnings about ignored return values for functions declared with attribute warn_unused_result, in ContentParent.cpp: > ContentParent.cpp: In member function ‘virtual nsresult mozilla::dom::ContentParent::Observe(nsISupports*, const char*, const PRUnichar*)’: > ContentParent.cpp:368: warning: ignoring return value of ‘bool mozilla::dom::PContentParent::SendFlushMemory(const nsString&)’, declared with attribute warn_unused_result > ContentParent.cpp: In member function ‘virtual nsresult mozilla::dom::ContentParent::HandleEvent(nsIDOMGeoPosition*)’: > ContentParent.cpp:795: warning: ignoring return value of ‘bool mozilla::dom::PContentParent::SendGeolocationUpdate(nsIDOMGeoPosition* const&)’, declared with attribute warn_unused_result > ContentParent.cpp: In member function ‘virtual nsresult mozilla::dom::ContentParent::OnAccelerationChange(nsIAcceleration*)’: > ContentParent.cpp:843: warning: ignoring return value of ‘bool mozilla::dom::PContentParent::SendAccelerationChanged(const double&, const double&, const double&)’, declared with attribute warn_unused_result Looks like the lines of code in question are from three different bugs/csets: Bug 618533 - http://hg.mozilla.org/mozilla-central/rev/888d64457836 Bug 587414 - http://hg.mozilla.org/mozilla-central/rev/814f092ecaf9 Bug 605341 - http://hg.mozilla.org/mozilla-central/rev/22121066081d Presumably we should be doing one of the following: (a) checking the return value, if the return val always matters (b) drop the warn_unused_result, if return val doesn't matter (c) capture & drop the return value, if it sometimes matters but doesn't matter in this case, to silence the build-spam.
The typical thing to do here is use mozilla::unused << whatever if the return values for IPDL functions don't matter.
These have all been fixed, I'm pretty sure.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.