Closed Bug 1124029 Opened 9 years ago Closed 9 years ago

Fix some warnings when build for win64 with --enable-warnings-as-error

Categories

(Core :: General, defect)

x86_64
Windows 8.1
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38

People

(Reporter: xidorn, Assigned: xidorn)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

      No description provided.
(In reply to Xidorn Quan [:xidorn] (UTC+11) from comment #4)
> Created attachment 8552173 [details] [diff] [review]
> patch 4 - Suppress different __unaligned qualifiers warnings

This patch fixes warnings like:
Warning: C4090 in xpcom\io\nsLocalFileWin.cpp: 'initializing' : different '__unaligned' qualifiers
xpcom/io/nsLocalFileWin.cpp(188) : warning C4090: 'initializing' : different '__unaligned' qualifiers
Comment on attachment 8552171 [details] [diff] [review]
patch 2 - Fix 64bit shift warning in imgFrame

What's the warning/error that we're fixing here?
(In reply to Timothy Nikkel (:tn) from comment #6)
> Comment on attachment 8552171 [details] [diff] [review]
> patch 2 - Fix 64bit shift warning in imgFrame
> 
> What's the warning/error that we're fixing here?

Warning: C4334 in image\src\imgFrame.h: '<<' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
image\src\imgFrame.h(299) : warning C4334: '<<' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
Comment on attachment 8552171 [details] [diff] [review]
patch 2 - Fix 64bit shift warning in imgFrame

Seeing as the return value is uint32_t, we don't need a 64-bit shift, so why not cast the sizeof to uint32_t instead?
(In reply to neil@parkwaycc.co.uk from comment #8)
> Comment on attachment 8552171 [details] [diff] [review]
> patch 2 - Fix 64bit shift warning in imgFrame
> 
> Seeing as the return value is uint32_t, we don't need a 64-bit shift, so why
> not cast the sizeof to uint32_t instead?

Because according to the context, I think size_t should be the correct type here. I wanted to also change the return type of that function, but I guess it is probably too much for just fixing a warning.
Attachment #8552172 - Flags: review?(jwalden+bmo) → review+
Attachment #8552171 - Flags: review?(tnikkel) → review+
Attachment #8552170 - Flags: review?(dbolter) → review+
Comment on attachment 8552173 [details] [diff] [review]
patch 4 - Suppress different __unaligned qualifiers warnings

I don't have enough context to know whether the warning is spurious or whether this is a good fix.
Attachment #8552173 - Flags: review?(benjamin) → review?(nfroyd)
Comment on attachment 8552173 [details] [diff] [review]
patch 4 - Suppress different __unaligned qualifiers warnings

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

I couldn't figure out where the __unaligned qualifiers were coming from, since MSDN says ILCreateFromPath returns a PIDLIST_ABSOLUTE, not a PUIDLIST_ABSOLUTE:

https://msdn.microsoft.com/en-us/library/windows/desktop/dd378420%28v=vs.85%29.aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/bb773321%28v=vs.85%29.aspx

But looking at <ShTypes.h>, it looks like if you don't define STRICT_TYPED_ITEMIDS (which actually seems like a good idea), PIDLIST_ABSOLUTE silently inherits an __unaligned qualifier from being defined as a synonym to LPITEMIDLIST.
Attachment #8552173 - Flags: review?(nfroyd) → review+
Blocks: 1126017
Keywords: leave-open
Attachment #8555480 - Flags: review?(nfroyd)
Attachment #8555480 - Flags: review?(nfroyd) → review+
__unaligned is meaningless in the amd64 build; it's only relevant to the Itanium compiler. Hacking around the warning is fine.
Keywords: leave-open
https://hg.mozilla.org/mozilla-central/rev/a53de22d85ad
Assignee: nobody → quanxunzhen
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: