Closed Bug 1316120 Opened 3 years ago Closed 3 years ago

clang-cl error in nsLocalFileWin.cpp in 64-bit builds

Categories

(Core :: XPCOM, defect)

x86_64
Windows
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: froydnj, Assigned: dmajor)

References

Details

Attachments

(1 file, 1 obsolete file)

I don't have the error in front of me, but clang-cl is complaining that you can't remove __unaligned from a pointer type via static_cast, but __unaligned doesn't have any effect on x86-64.

This is a 64-bit specific problem in clang-cl where it rejects code that MSVC (rightly) accepts.  The corresponding LLVM bug is https://llvm.org/bugs/show_bug.cgi?id=30578, but I don't know if it's likely to get fixed soon or how hard it would be for someone from Mozilla to fix it.

I have a patch for this, but it's a bit gross.
Duplicate of this bug: 1306690
Comment on attachment 8808804 [details]
Bug 1316120 - use more Win32 API-ish types in nsLocalFileWin.cpp;

https://reviewboard.mozilla.org/r/91538/#review91388

Feel completely free to reject this patch; this was mostly trying to cobble together bits and pieces from online examples until the compiler was happy.  I'm not completely convinced it actually matches up to the behavior of the previous code.
Attached patch Another approachSplinter Review
Maybe this would be simpler?
Attachment #8808819 - Flags: review?(nfroyd)
Comment on attachment 8808819 [details] [diff] [review]
Another approach

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

Works on 32-bit too, much simpler than my patch, let's go with it.
Attachment #8808819 - Flags: review?(nfroyd) → review+
Attachment #8808804 - Attachment is obsolete: true
Attachment #8808804 - Flags: review?(aklotz)
Assignee: nobody → dmajor
Pushed by dmajor@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8d647917ebe1
Fix nsLocalFileWin.cpp build on clang-cl. r=froydnj
https://hg.mozilla.org/mozilla-central/rev/8d647917ebe1
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.