Closed Bug 1312549 Opened 8 years ago Closed 8 years ago

clang-cl error in GeckoChildProcessHost.cpp: ordered comparison between pointer and zero

Categories

(Core :: IPC, defect)

All
Windows
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: froydnj, Unassigned)

References

Details

Attachments

(1 file)

clang-cl complains thusly:

 8:28.55 c:/m-c/ipc/glue/GeckoChildProcessHost.cpp(123,27):  error: ordered comparison between pointer and zero ('ProcessHandle' (aka 'void *') and 'int')
 8:28.55   if (mChildProcessHandle > 0) {
 8:28.55       ~~~~~~~~~~~~~~~~~~~ ^ ~
 8:28.55 1 error generated.

(This is a recent clang change; I can dig up the rationale if people are interested.)

We need to come up with a better representation here, or do platform-specific checks against mChildProcessHandle.  Or perhaps just testing != 0 is sufficient?
clang has recently made |x $RELATIONAL_OP 0|, where |x| is a variable of
pointer type, to be an error.  On Windows,
GeckoChildProcessHost::mChildProcessHandle is a HANDLE, which is really
just a pointer.  So the comparison |> 0| in ~GeckoChildProcessHost is
invalid.  Fortunately, we can use an equality comparison here and it
amounts to the same thing.
Attachment #8804247 - Flags: review?(wmccloskey)
Attachment #8804247 - Flags: review?(wmccloskey) → review+
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/2a18e840e4b8
use equality comparison rather than ordered comparison in ~GeckoChildProcessHost; r=billm
QA Contact: nfroyd
https://hg.mozilla.org/mozilla-central/rev/2a18e840e4b8
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: