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...
Product: Core
Classification: Components
Component: Networking (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: Daniel Holbert [:dholbert]
: Patrick McManus [:mcmanus]
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:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

fix: use mozilla::DebugOnly<nsresult> (2.80 KB, patch)
2011-05-13 13:01 PDT, Daniel Holbert [:dholbert]
jduell.mcbugs: review+
Details | Diff | Splinter 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 = 
      // some expression
      // sanity-check rv use DebugOnly, too.

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!
Comment 4 Jason Duell [:jduell] (needinfo me) 2011-05-14 00:03:13 PDT

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