Last Comment Bug 656992 - 546 lines of build warning spam from "NeckoMessageUtils.h:* warning: unused variable 'rv'"
: 546 lines of build warning spam from "NeckoMessageUtils.h:* warning: unused v...
Status: RESOLVED FIXED
[build_warning]
:
Product: Core
Classification: Components
Component: Networking (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: Daniel Holbert [:dholbert]
:
Mentors:
http://tinderbox.mozilla.org/showlog....
Depends on:
Blocks: 536289
  Show dependency treegraph
 
Reported: 2011-05-13 12:51 PDT by Daniel Holbert [:dholbert]
Modified: 2011-05-14 00:08 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
fix: use mozilla::DebugOnly<nsresult> (2.80 KB, patch)
2011-05-13 13:01 PDT, Daniel Holbert [:dholbert]
jduell.mcbugs: review+
Details | Diff | Review

Description Daniel Holbert [:dholbert] 2011-05-13 12:51:32 PDT
When building an opt build, we get 546 lines of this build-warning-spam:
> NeckoMessageUtils.h: In static member function 'static void IPC::ParamTraits<IPC::InputStream>::Write(IPC::Message*, const IPC::ParamTraits<IPC::InputStream>::paramType&)':
> NeckoMessageUtils.h:219:18: warning: unused variable 'rv'
> NeckoMessageUtils.h:230:14: warning: unused variable 'rv'

(Apparently lots of files include that header, directly or indirectly)
Comment 1 Daniel Holbert [:dholbert] 2011-05-13 13:01:51 PDT
Created attachment 532321 [details] [diff] [review]
fix: use mozilla::DebugOnly<nsresult>

This fixes these spots using the magical new DebugOnly template.*

I've also fixed one existing instance of...
  #ifdef DEBUG
     nsresult rv = 
  #endif
      // some expression
      // sanity-check rv

...to use DebugOnly, too.

* https://developer.mozilla.org/index.php?title=En/Namespace/Mozilla/DebugOnly%3CT%3E
Comment 2 Jason Duell [:jduell] (needinfo? me) 2011-05-13 13:09:05 PDT
Comment on attachment 532321 [details] [diff] [review]
fix: use mozilla::DebugOnly<nsresult>

What do you know--every once in a while C++ is actually slick in an almost straightforward way.   Thanks for the patch!
Comment 3 Daniel Holbert [:dholbert] 2011-05-13 13:33:56 PDT
Thanks for the speedy review!
http://hg.mozilla.org/projects/cedar/rev/cf70935c912b
Comment 4 Jason Duell [:jduell] (needinfo? me) 2011-05-14 00:03:13 PDT
http://hg.mozilla.org/mozilla-central/rev/cf70935c912b

Note You need to log in before you can comment on or make changes to this bug.