Closed Bug 1021494 Opened 10 years ago Closed 10 years ago

Fix a compiler error with clang-cl in nsScriptableInputStream.cpp

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX
mozilla32

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

References

Details

Attachments

(1 file)

      No description provided.
Assignee: nobody → ehsan
Blocks: winclang
Comment on attachment 8435501 [details] [diff] [review]
Fix a compiler error with clang-cl in nsScriptableInputStream.cpp

I guess clang-cl actually expects to see C++... ;)
Attachment #8435501 - Flags: review?(nfroyd)
Why the first cast is C style (|(uint32_t)XPCOM_MIN...|) while the second cast is function-style (|uint32_t(UINT32_MAX - 1)|)?
Comment on attachment 8435501 [details] [diff] [review]
Fix a compiler error with clang-cl in nsScriptableInputStream.cpp

Review of attachment 8435501 [details] [diff] [review]:
-----------------------------------------------------------------

For posterity: Ehsan and I discussed this on IRC, and UINT32_MAX appears to be defined via MS extensions as 0xffffffffui32.  Apparently clang-cl's support of this extension is incomplete, so it requires the explicit cast to uint32_t.

I think this is unfortunate, but I suppose it's OK.  Just so we don't have a proliferation of these. ;)
Attachment #8435501 - Flags: review?(nfroyd) → review+
(In reply to Masatoshi Kimura [:emk] from comment #3)
> Why the first cast is C style (|(uint32_t)XPCOM_MIN...|) while the second
> cast is function-style (|uint32_t(UINT32_MAX - 1)|)?

Because they were written by different people.  But since my cast is always better, I fixed the other one.  ;-)

https://hg.mozilla.org/integration/mozilla-inbound/rev/f5232023af37
https://hg.mozilla.org/mozilla-central/rev/f5232023af37
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
Backed out because the upstream bug was fixed: https://hg.mozilla.org/integration/mozilla-inbound/rev/740c7ba3d181
Resolution: FIXED → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: