conversion from 'int' to PBYTE/'PWORD/etc' of greater size

This happens on a x64 build (no previous x86 and I don't have a lot of experience with x64).

I know that pointers are 8 bytes long (not 4 like on x86).

I have a not so fancy initialization that goes like this:
PBYTE byteAdr = (PBYTE)0xB0000; // some magic value

A PBYTE, being a pointer, is 8 bytes long so 0xB0000 should fit with no problems.
Turns out, Visual Studio doesn't like this:
warning C4306: 'type cast' : conversion from 'int' to 'PBYTE' of greater size


Why and how should I correct this?
If you are using C++11 (and you should), add ll to the end of literal (and do not use C-casts)

PBYTE byteAdr = static_cast<PBYTE>(0xB0000ll); // some magic value
Topic archived. No new replies allowed.