Closed
Bug 228780
Opened 21 years ago
Closed 9 years ago
Fix all "Unused variable '[...]'" 'Build Warnings' (Part 2/2: "with function call")
Categories
(SeaMonkey :: Build Config, defect)
SeaMonkey
Build Config
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: sgautherie, Assigned: sgautherie)
References
(Blocks 1 open bug)
Details
(Whiteboard: [build_warning][Leave open until there is no more such warnings in tinderbox])
Attachments
(5 files, 5 obsolete files)
1.25 KB,
patch
|
sgautherie
:
review+
sgautherie
:
superreview+
chofmann
:
approval1.7a+
|
Details | Diff | Splinter Review |
1.33 KB,
patch
|
Details | Diff | Splinter Review | |
1.03 KB,
patch
|
roc
:
review+
dbaron
:
superreview+
|
Details | Diff | Splinter Review |
4.79 KB,
patch
|
darin.moz
:
review-
|
Details | Diff | Splinter Review |
2.05 KB,
patch
|
sgautherie
:
review+
dmosedale
:
superreview+
|
Details | Diff | Splinter Review |
This bug goes along bug 90906.
Assignee | ||
Updated•21 years ago
|
Assignee | ||
Updated•21 years ago
|
Assignee | ||
Comment 1•21 years ago
|
||
Fix for: { /builds/tinderbox/Mozilla1.6/Darwin_6.6_Clobber/mozilla/webshell/tests/viewer/nsMacMain.cpp: In function `int main(int, char**)': /builds/tinderbox/Mozilla1.6/Darwin_6.6_Clobber/mozilla/webshell/tests/viewer/nsMacMain.cpp:450: warning: unused variable `OSErr err' }
Assignee | ||
Comment 2•21 years ago
|
||
Comment on attachment 137724 [details] [diff] [review] (Av1) <nsMacMain.cpp> 'r=?': (see comment 1) I have no compiler: Can you compile/test/review it ? Thanks.
Attachment #137724 -
Flags: review?(cls)
Assignee | ||
Updated•21 years ago
|
Whiteboard: [Leave open until there is no more such warnings in tinderbox]
Assignee | ||
Comment 3•21 years ago
|
||
Patch Av1, more explicit.
Assignee | ||
Comment 4•21 years ago
|
||
Comment on attachment 137748 [details] [diff] [review] (Av1b) <nsMacMain.cpp> 'r=?': (see comment 1) I have no compiler: Can you compile/test/review it ? Thanks.
Attachment #137748 -
Flags: review?(cls)
Assignee | ||
Updated•21 years ago
|
Attachment #137724 -
Attachment is obsolete: true
Attachment #137724 -
Flags: review?(cls)
Assignee | ||
Comment 5•21 years ago
|
||
Solve { (bienvenu) 83. db/mork/src/morkParser.cpp:1375 (See build log excerpt) Unused variable `nsresult rv' 1373 mork_pos here; 1374 nsIMdbEnv *ev = mev->AsMdbEnv(); 1375 nsresult rv= mParser_Stream->Tell(ev, &here); 1376 if ( here > 0 ) // positive? 1377 --here; }
Assignee | ||
Comment 6•21 years ago
|
||
Comment on attachment 139057 [details] [diff] [review] (Bv1) <morkParser.cpp> I have no compiler: Could you compile/test/review it ? Thanks.
Attachment #139057 -
Flags: review?(bienvenu)
Attachment #137748 -
Flags: review?(cls) → review?(pinkerton)
Comment 7•21 years ago
|
||
Comment on attachment 137748 [details] [diff] [review] (Av1b) <nsMacMain.cpp> r=pink
Attachment #137748 -
Flags: review?(pinkerton) → review+
Assignee | ||
Updated•21 years ago
|
Attachment #137748 -
Flags: superreview?(bryner)
Comment 8•21 years ago
|
||
Comment on attachment 137748 [details] [diff] [review] (Av1b) <nsMacMain.cpp> The explicit |(void)| cast should not be needed. sr=bryner if you remove that.
Attachment #137748 -
Flags: superreview?(bryner) → superreview+
Assignee | ||
Updated•21 years ago
|
Attachment #137748 -
Attachment is obsolete: true
Assignee | ||
Comment 9•21 years ago
|
||
Av1b, with comment 8 suggestion(s): *Removal of the explicit |(void)| cast, which was only there for human reader. *Line up the next two lines of parameters, previously untouched.
Assignee | ||
Comment 10•21 years ago
|
||
Comment on attachment 141227 [details] [diff] [review] (Av1c) <nsMacMain.cpp> [Checked in: Comment 13] Keeping { (Av1b) <nsMacMain.cpp> patch 2003-12-20 05:33 PST pinkerton: review+ bryner: superreview+ }
Attachment #141227 -
Flags: superreview+
Attachment #141227 -
Flags: review+
Assignee | ||
Comment 11•21 years ago
|
||
Comment on attachment 141227 [details] [diff] [review] (Av1c) <nsMacMain.cpp> [Checked in: Comment 13] 'approval1.7a?': trivial warning fix, no risk.
Attachment #141227 -
Flags: approval1.7a?
Comment 12•21 years ago
|
||
Comment on attachment 141227 [details] [diff] [review] (Av1c) <nsMacMain.cpp> [Checked in: Comment 13] a=chofmann
Attachment #141227 -
Flags: approval1.7a? → approval1.7a+
Assignee | ||
Comment 13•21 years ago
|
||
Comment on attachment 141227 [details] [diff] [review] (Av1c) <nsMacMain.cpp> [Checked in: Comment 13] Check in: { 02/12/2004 09:11 neil%parkwaycc.co.uk mozilla/ webshell/ tests/ viewer/ nsMacMain.cpp 1.55 }
Attachment #141227 -
Attachment description: (Av1c) <nsMacMain.cpp> → (Av1c) <nsMacMain.cpp>
[Checked in: Comment 13]
Attachment #141227 -
Attachment is obsolete: true
Comment 14•21 years ago
|
||
marking fixed
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment 15•20 years ago
|
||
Comment on attachment 139057 [details] [diff] [review] (Bv1) <morkParser.cpp> const nsresult rv isn't mozilla style even if the variable only gets used once.
Assignee | ||
Updated•20 years ago
|
Attachment #139057 -
Attachment is obsolete: true
Attachment #139057 -
Flags: review?(bienvenu)
Assignee | ||
Comment 16•20 years ago
|
||
Bv1, with comment 15 suggestion(s); and without additional white-space cleanup.
Assignee | ||
Updated•20 years ago
|
Attachment #146639 -
Flags: review?(neil.parkwaycc.co.uk)
Assignee | ||
Updated•20 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Updated•20 years ago
|
Status: REOPENED → ASSIGNED
Assignee | ||
Comment 17•20 years ago
|
||
Comment on attachment 146639 [details] [diff] [review] (Bv1b-r) <morkParser.cpp> (for review only) I have no compiler: Can you compile/test/review it ? Thanks.
Comment 18•20 years ago
|
||
Comment on attachment 146639 [details] [diff] [review] (Bv1b-r) <morkParser.cpp> (for review only) Looks good to me, it seems more consistent with End/StartSpanOnThisByte.
Attachment #146639 -
Flags: review?(neil.parkwaycc.co.uk) → review+
Assignee | ||
Updated•20 years ago
|
Attachment #146639 -
Flags: superreview?(sspitzer)
Assignee | ||
Updated•20 years ago
|
Attachment #146639 -
Flags: superreview?(sspitzer) → superreview?(bienvenu)
Assignee | ||
Comment 19•20 years ago
|
||
Comment on attachment 146639 [details] [diff] [review] (Bv1b-r) <morkParser.cpp> (for review only) No super-review from <bienvenu@nventure.com> since '2004-04-26' :-(
Attachment #146639 -
Flags: superreview?(bienvenu) → superreview?(brendan)
Comment 20•20 years ago
|
||
Comment on attachment 146639 [details] [diff] [review] (Bv1b-r) <morkParser.cpp> (for review only) rs=me, I'm trusting you guys, patch looks ok from the context diff. /be
Attachment #146639 -
Flags: superreview?(brendan) → superreview+
Assignee | ||
Comment 21•20 years ago
|
||
Bv1b-r, with full white-space diff.
Attachment #146639 -
Attachment is obsolete: true
Comment 22•20 years ago
|
||
Comment on attachment 146639 [details] [diff] [review] (Bv1b-r) <morkParser.cpp> (for review only) moa=bienvenu
Assignee | ||
Comment 23•20 years ago
|
||
Comment on attachment 151402 [details] [diff] [review] (Bv1b-ci) <morkParser.cpp> (for check-in) [Checked in: Comment 23] Check in: { 2004-06-22 09:06 neil%parkwaycc.co.uk mozilla/ db/ mork/ src/ morkParser.cpp 1.23 }
Attachment #151402 -
Attachment description: (Bv1b-ci) <morkParser.cpp> (for check-in) → (Bv1b-ci) <morkParser.cpp> (for check-in)
[Checked in: Comment 23]
Attachment #151402 -
Attachment is obsolete: true
Assignee | ||
Updated•20 years ago
|
Attachment #146639 -
Attachment description: (Bv1b-r) <morkParser.cpp> (for review only) → (Bv1b-r) <morkParser.cpp> (for review only)
[Check in: See Bv1b-ci]
Assignee | ||
Comment 24•20 years ago
|
||
Fix for {{ bienvenu 1. mailnews/base/search/src/nsMsgBodyHandler.cpp:133 (See build log excerpt) Unused variable `nsresult rv' 131 { 132 nsCOMPtr <nsIInputStream> inputStream; 133 nsresult rv = m_scope->GetInputStream(getter_AddRefs(inputStream)); 134 if (inputStream) 135 { }}
Assignee | ||
Comment 25•20 years ago
|
||
Matthias: I'm CC'ing you; note that for some time, my primary ISP STMP service has been enable to send you my messages... :-(
Assignee | ||
Comment 26•20 years ago
|
||
Comment on attachment 151481 [details] [diff] [review] (Cv1) <nsMsgBodyHandler.cpp> Matthias: Could you try to compile, and possibly test, this patch ? Thanks. Note {{ GetInputStream Defined as a function in: * mailnews/base/search/src/nsMsgSearchTerm.cpp, line 1464, as member of class nsMsgSearchScopeTerm }}
Attachment #151481 -
Flags: superreview?(bienvenu)
Attachment #151481 -
Flags: review?(neil.parkwaycc.co.uk)
Updated•20 years ago
|
Attachment #151481 -
Flags: review?(neil.parkwaycc.co.uk) → review+
Comment 27•20 years ago
|
||
Comment on attachment 151481 [details] [diff] [review] (Cv1) <nsMsgBodyHandler.cpp> Compiles and works.
Assignee | ||
Comment 28•20 years ago
|
||
Fix for {{ roc+ 22. view/src/nsViewManager.cpp:2332 (See build log excerpt) Unused variable `nsresult rv' 2330 nsCOMPtr<nsIWidget> parentWidget = getter_AddRefs(widget->GetParent()); 2331 if (parentWidget.get() != aNewWidget) { 2332 nsresult rv = widget->SetParent(aNewWidget); 2333 NS_ASSERTION(NS_SUCCEEDED(rv), "SetParent failed!"); 2334 } }} (LineNo is now 2353.) due to {{ 3.323 <roc+@cs.cmu.edu> 2004-04-07 08:22 Bug 235897. hidden widgets don't count as part of the opque region. r+sr=dbaron,a=mkaply }} (This is not in the patch attached to that bug: added when checked in.)
Assignee | ||
Comment 29•20 years ago
|
||
Comment on attachment 151802 [details] [diff] [review] (Dv1) <nsViewManager.cpp> [Checked in: Comment 45] Matthias: Could you try to compile, and possibly test, this patch ? Thanks.
Attachment #151802 -
Flags: superreview?(dbaron)
Attachment #151802 -
Flags: review?(roc)
Assignee | ||
Comment 30•20 years ago
|
||
Fix for 9 |Unused variable `{...}'|, blamed at warren (20, 21), mjudge (5-10), jband (7); plus a few code rewrites.
Assignee | ||
Comment 31•20 years ago
|
||
Comment on attachment 151818 [details] [diff] [review] (Ev1) <xpcom/tests/*.cpp> Matthias: Could you try to compile, and possibly test, this patch ? Thanks. Doug:
Attachment #151818 -
Flags: review?(dougt)
Comment 32•20 years ago
|
||
Comment on attachment 151802 [details] [diff] [review] (Dv1) <nsViewManager.cpp> [Checked in: Comment 45] Compiles and works.
Comment 33•20 years ago
|
||
Comment on attachment 151818 [details] [diff] [review] (Ev1) <xpcom/tests/*.cpp> What must I do to compile these files? My "make -f client.mk build" doesn't do that.
Attachment #151802 -
Flags: superreview?(dbaron) → superreview+
Assignee | ||
Comment 34•20 years ago
|
||
Comment on attachment 151818 [details] [diff] [review] (Ev1) <xpcom/tests/*.cpp> No super-review from <dougt@meer.net> since "2004-06-27" :-( I have no compiler (and Matthias can't): Could you compile/test/review this patch ? Thanks.
Attachment #151818 -
Flags: review?(dougt) → review?(alecf)
Assignee | ||
Comment 35•20 years ago
|
||
Comment on attachment 151481 [details] [diff] [review] (Cv1) <nsMsgBodyHandler.cpp> No super-review from <bienvenu@nventure.com> since "2004-06-22" :-(
Attachment #151481 -
Flags: superreview?(bienvenu) → superreview?(dmose)
Comment 36•20 years ago
|
||
Comment on attachment 151481 [details] [diff] [review] (Cv1) <nsMsgBodyHandler.cpp> > void nsMsgBodyHandler::OpenLocalFolder() > { > nsCOMPtr <nsIInputStream> inputStream; > nsresult rv = m_scope->GetInputStream(getter_AddRefs(inputStream)); >- if (inputStream) >+ if (NS_SUCCEEDED(rv) && inputStream) > { > Is there ever a legimate case where NS_SUCCEEDED(rv) could return true and inputStream could be null? If not, a better fix would be something along the lines of: > if (NS_SUCCEEDED(rv)) > { > NS_ASSERTION(inputStream, "NULL inputStream returned")
Assignee | ||
Comment 37•20 years ago
|
||
(In reply to comment #36) > (From update of attachment 151481 [details] [diff] [review]) > Is there ever a legimate case where NS_SUCCEEDED(rv) could return true and > inputStream could be null? I wouldn't know: CC'ing bienvenu (as blamed author) ! Or I could simply prepare a patch your way ?
Comment 38•20 years ago
|
||
no, if there's no input stream, an error should be returned. Adding an extra check is just code bloat.
Assignee | ||
Comment 39•20 years ago
|
||
(In reply to comment #38) > no, if there's no input stream, an error should be returned. Adding an extra > check is just code bloat. Then, should I go for the assertion, or can I simply get rid of the inputStream test (== _replaced_ by rv test only) ?
Comment 40•20 years ago
|
||
Serge: sounds like either way would be fine. Might as well just replace.
Assignee | ||
Comment 41•20 years ago
|
||
Cv1, with comment 40 suggestions.
Assignee | ||
Updated•20 years ago
|
Attachment #151481 -
Attachment is obsolete: true
Attachment #151481 -
Flags: superreview?(dmose)
Assignee | ||
Comment 42•20 years ago
|
||
Comment on attachment 156855 [details] [diff] [review] (Cv2) <nsMsgBodyHandler.cpp> [Checked in: Comment 44] Keeping {{ (Cv1) <nsMsgBodyHandler.cpp> patch 2004-06-22 15:20 PDT neil.parkwaycc.co.uk: review+ }}
Attachment #156855 -
Flags: superreview?(dmose)
Attachment #156855 -
Flags: review+
Comment 43•20 years ago
|
||
Comment on attachment 156855 [details] [diff] [review] (Cv2) <nsMsgBodyHandler.cpp> [Checked in: Comment 44] sr=dmose
Attachment #156855 -
Flags: superreview?(dmose) → superreview+
Assignee | ||
Comment 44•20 years ago
|
||
Comment on attachment 156855 [details] [diff] [review] (Cv2) <nsMsgBodyHandler.cpp> [Checked in: Comment 44] Check in: { 2004-08-24 03:14 neil%parkwaycc.co.uk mozilla/ mailnews/ base/ search/ src/ nsMsgBodyHandler.cpp 1.27 }
Attachment #156855 -
Attachment description: (Cv2) <nsMsgBodyHandler.cpp> → (Cv2) <nsMsgBodyHandler.cpp>
[Checked in: Comment 44]
Attachment #156855 -
Attachment is obsolete: true
Comment on attachment 151802 [details] [diff] [review] (Dv1) <nsViewManager.cpp> [Checked in: Comment 45] checked in too.
Attachment #151802 -
Flags: review?(roc) → review+
Assignee | ||
Updated•20 years ago
|
Attachment #151802 -
Attachment description: (Dv1) <nsViewManager.cpp> → (Dv1) <nsViewManager.cpp>
[Checked in: Comment 45]
Attachment #151802 -
Attachment is obsolete: true
Updated•20 years ago
|
Product: Browser → Seamonkey
Assignee | ||
Comment 46•20 years ago
|
||
Comment on attachment 151818 [details] [diff] [review] (Ev1) <xpcom/tests/*.cpp> No review from <alecf@flett.org> since "2004-08-23" :-( I have no compiler (and Matthias can't): Could you compile/test/review this patch ? Thanks.
Attachment #151818 -
Flags: review?(alecf) → review?(darin)
Comment 47•20 years ago
|
||
Comment on attachment 151818 [details] [diff] [review] (Ev1) <xpcom/tests/*.cpp> >Index: mozilla/xpcom/tests/TestArray.cpp >+#ifdef DEBUG >+ nsresult rv = >+#endif >+ aArray->Count(&cnt); > NS_ASSERTION(NS_SUCCEEDED(rv), "Count failed"); hmm... the point of these tests seems to be to check that things are functioning correctly. perhaps the problem here is that NS_ASSERTION is used to do the checking. perhaps in a non-debug build it would be useful to do error checking as well. i think i'd change this to always check |rv| and then output an error message such that even in a non-debug build the user would see a problem being reported. since stdout is disabled in Win32 non-debug builds, one good soln is to use NSPR logging (that's what i do in netwerk/test). >+static void Check(const char * const s1, const char * const s2, const PRIntn n) > { >+#ifdef DEBUG >+ PRIntn clib = >+#endif >+ PL_strcmp(s1, s2); >+#ifdef DEBUG >+ PRIntn clib_n = >+#endif >+ PL_strncmp(s1, s2, n); >+/* > PRIntn clib_case = PL_strcasecmp(s1, s2); > PRIntn clib_case_n = PL_strncasecmp(s1, s2, n); >+*/ why comment out this code? should it be removed instead? >+#ifdef DEBUG >+ PRIntn u2 = >+#endif >+ nsCRT::strcmp(us1, us2); >+#ifdef DEBUG >+ PRIntn u2_n = >+#endif >+ nsCRT::strncmp(us1, us2, n); > > NS_ASSERTION(sign(clib) == sign(u2), "strcmp"); > NS_ASSERTION(sign(clib_n) == sign(u2_n), "strncmp"); > } so, the whole point of this function seems to be to perform the assertion. so, what's the point of compiling this code in non-debug builds? or better yet, why not change the code as i suggested above so that it is useful in a non-debug build? the same problem occurs throughout this patch. the only thing the patch does is silence compiler warnings in non-debug builds. you could do the same by using --disable-tests in your mozconfig. perhaps the tests should be made to work in non-debug builds instead.
Attachment #151818 -
Flags: review?(darin) → review-
Assignee | ||
Updated•16 years ago
|
Attachment #151402 -
Attachment is obsolete: false
Assignee | ||
Updated•16 years ago
|
Attachment #151802 -
Attachment is obsolete: false
Assignee | ||
Updated•16 years ago
|
Attachment #156855 -
Attachment is obsolete: false
Assignee | ||
Updated•16 years ago
|
Attachment #141227 -
Attachment is obsolete: false
Assignee | ||
Updated•16 years ago
|
Attachment #146639 -
Attachment description: (Bv1b-r) <morkParser.cpp> (for review only)
[Check in: See Bv1b-ci] → (Bv1b-r) <morkParser.cpp> (for review only)
Comment 48•14 years ago
|
||
compiler warnings are build config, let's put this there.
Component: General → Build Config
QA Contact: general → build-config
Updated•13 years ago
|
Blocks: buildwarning
Whiteboard: [Leave open until there is no more such warnings in tinderbox] → [build_warning][Leave open until there is no more such warnings in tinderbox]
Comment 49•9 years ago
|
||
All -Wunused-variable warnings have been fixed. \o/
Status: ASSIGNED → RESOLVED
Closed: 21 years ago → 9 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•