Last Comment Bug 822822 - fix "warning: comparison between signed and unsigned integer expressions [-Wsign-compare]" in nsMailApp.cpp and nsSuiteApp.cpp
: fix "warning: comparison between signed and unsigned integer expressions [-Ws...
Status: RESOLVED FIXED
:
Product: MailNews Core
Classification: Components
Component: Backend (show other bugs)
: Trunk
: x86 Linux
: -- trivial (vote)
: Thunderbird 20.0
Assigned To: :aceman
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-18 13:50 PST by :aceman
Modified: 2012-12-23 06:17 PST (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch (2.21 KB, patch)
2012-12-18 13:53 PST, :aceman
neil: review+
standard8: review+
Details | Diff | Review

Description :aceman 2012-12-18 13:50:50 PST
Fix gcc warning:
mail/app/nsMailApp.cpp:131:78: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Comment 1 :aceman 2012-12-18 13:53:01 PST
Created attachment 693612 [details] [diff] [review]
patch

This casts to size_t in the same way Firefox does in nsBrowserApp.cpp.
Comment 2 neil@parkwaycc.co.uk 2012-12-18 14:05:20 PST
Comment on attachment 693612 [details] [diff] [review]
patch

I'd be tempted to write the expression in a way that doesn't need a cast e.g.

if (!lastSlash || lastSlash >= exePath + MAXPATHLEN - sizeof(XPCOM_DLL) - 1)
Comment 3 :aceman 2012-12-20 06:00:00 PST
(In reply to neil@parkwaycc.co.uk from comment #2)
> I'd be tempted to write the expression in a way that doesn't need a cast e.g.
> 
> if (!lastSlash || lastSlash >= exePath + MAXPATHLEN - sizeof(XPCOM_DLL) - 1)

Maybe you can make Firefox also adopt this version?
Comment 4 Ryan VanderMeulen [:RyanVM] 2012-12-23 06:17:37 PST
https://hg.mozilla.org/comm-central/rev/4e4dbac5d4c0

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