Closed Bug 1380103 Opened 7 years ago Closed 7 years ago

Invalid conversion from WINAPI function pointer to void*

Categories

(Core :: mozglue, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: tjr, Assigned: tjr)

References

(Blocks 1 open bug)

Details

(Whiteboard: [tor])

Attachments

(1 file)

> /home/tom/Documents/moz/mingw-work/just-build-6/mozglue/build/WindowsDllBlocklist.cpp: In function ‘void patched_BaseThreadInitThunk(BOOL, void*, void*)’: > /home/tom/Documents/moz/mingw-work/just-build-6/mozglue/build/WindowsDllBlocklist.cpp:812:19: error: invalid conversion from ‘DWORD (__attribute__((__stdcall__)) *)(void*) {aka long unsigned int (__attribute__((__stdcall__)) *)(void*)}’ to ‘void*’ [-fpermissive] > aStartAddress = NopThreadProc;
Attachment #8885413 - Flags: review?(aklotz)
Attachment #8885413 - Flags: review?(aklotz) → review?(ccorcoran)
Comment on attachment 8885413 [details] Bug 1380103 Cast a DWORD (__attribute__((__stdcall__)) *)(void*) to a bare void* to fix a compiler error https://reviewboard.mozilla.org/r/156260/#review163354 ::: mozglue/build/WindowsDllBlocklist.cpp:812 (Diff revision 1) > static MOZ_NORETURN void __fastcall > patched_BaseThreadInitThunk(BOOL aIsInitialThread, void* aStartAddress, > void* aThreadParam) > { > if (ShouldBlockThread(aStartAddress)) { > - aStartAddress = NopThreadProc; > + aStartAddress = (void*)NopThreadProc; Which settings are producing this error? I don't get this error. I'd say it's technically preferred to eliminate the need for casts by using the real datatypes instead of any void\*. But that may be a bit overly pedantic. Your call.
Attachment #8885413 - Flags: review?(ccorcoran) → review+
(In reply to Carl Corcoran [:ccorcoran] from comment #2) > Which settings are producing this error? I don't get this error. > > I'd say it's technically preferred to eliminate the need for casts by using > the real datatypes instead of any void\*. But that may be a bit overly > pedantic. Your call. Sorry, I had opened several bugs related to MinGW builds in a row and did not specify that in the description of this one. MSVC has several places where the compiler does friendly warning/error-less conversion for you that does not occur in gcc; so these casts are needed to make gcc's warnings as errors modes happy.
Keywords: checkin-needed
Autoland can't push this because it doesn't meet the review requirements in MozReview. http://mozilla-version-control-tools.readthedocs.io/en/latest/mozreview/autoland.html#landing-commits
Keywords: checkin-needed
dmajor can you enable this to land or land this?
Flags: needinfo?(dmajor)
Attachment #8885413 - Flags: review?(dmajor)
Comment on attachment 8885413 [details] Bug 1380103 Cast a DWORD (__attribute__((__stdcall__)) *)(void*) to a bare void* to fix a compiler error https://reviewboard.mozilla.org/r/156260/#review163588
Attachment #8885413 - Flags: review?(dmajor) → review+
Pushed by dmajor@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f47d61c64a1d Cast a DWORD (__attribute__((__stdcall__)) *)(void*) to a bare void* to fix a compiler error r=ccorcoran,dmajor
Flags: needinfo?(dmajor)
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: