Click here to Skip to main content
14,833,762 members
Home / Discussions / Linux Programming
   

Linux Programming

 
AnswerRe: Can "cast looses precision " error be optioned out ? Pin
k50543-Mar-20 5:52
mvek50543-Mar-20 5:52 
As Richard and Daniel have pointed out, you get this when trying to convert a pointer to a 32-bit integer in a 64 bit context. You should see the same issue when compiling for 64-bit windows or aarch-64, or indeed any 64-bit architecture.

I would take a look at the definition/implementation of mapmem(). That does not seem to be a linux standard library function, so I can only assume that it is something you have written yourself, or gleaned from the internet. That being the case, in any context, assigning a pointer to an integer is, in general, a sign that you are abusing the language type system. Pointers should remain pointers and ints should remain ints. If you do need to assign a pointer to an int, at least use intptr_t, which will work for most systems. It should certainly work for X86, X86-64, ARM32 and ARM64.

You could add -fpermissive to your complier flags, which will turn the errors intow warnings, but you still have the problem that you are assigning a 64 bit pointer to a 32 bit integer, and are almost certainly going to have serious execution problems.

If you absolutely need to stick with uint32_t for mapmem, then maybe you should compile your X86 code in 32 bit mode, by adding -m32 to the compiler flags. If you do that, you will need to install 32-bit versions, and development versions, of all of the system libraries you are using (libc, bluetooth, etc), and, of course, you will need to recompile your project and all its dependencies in 32 bit mode, too.
AnswerSOLVED Re: Can "cast looses precision " error be optioned out ? Pin
Vaclav_3-Mar-20 8:00
MemberVaclav_3-Mar-20 8:00 
GeneralRe: SOLVED Re: Can "cast looses precision " error be optioned out ? Pin
k50543-Mar-20 10:36
mvek50543-Mar-20 10:36 
GeneralRe: SOLVED Re: Can "cast looses precision " error be optioned out ? Pin
Vaclav_3-Mar-20 13:47
MemberVaclav_3-Mar-20 13:47 
QuestionBluetooth socket failures Pin
Vaclav_28-Feb-20 5:43
MemberVaclav_28-Feb-20 5:43 
AnswerRe: Bluetooth socket failures Pin
Richard MacCutchan28-Feb-20 6:32
mveRichard MacCutchan28-Feb-20 6:32 
GeneralRe: Bluetooth socket failures Pin
Vaclav_28-Feb-20 7:12
MemberVaclav_28-Feb-20 7:12 
GeneralRe: Bluetooth socket failures Pin
k505429-Feb-20 6:14
mvek505429-Feb-20 6:14 
GeneralRe: Bluetooth socket failures Pin
Vaclav_29-Feb-20 8:27
MemberVaclav_29-Feb-20 8:27 
GeneralRe: Bluetooth socket failures Pin
Richard MacCutchan29-Feb-20 21:19
mveRichard MacCutchan29-Feb-20 21:19 
GeneralRe: Bluetooth socket failures Pin
Vaclav_1-Mar-20 4:02
MemberVaclav_1-Mar-20 4:02 
GeneralRe: Bluetooth socket failures Pin
Vaclav_28-Feb-20 8:32
MemberVaclav_28-Feb-20 8:32 
QuestionRunning console apps on windows 7 Pin
CalinNegru(fearless_)23-Feb-20 20:07
MemberCalinNegru(fearless_)23-Feb-20 20:07 
AnswerRe: Running console apps on windows 7 Pin
Victor Nijegorodov23-Feb-20 20:45
MemberVictor Nijegorodov23-Feb-20 20:45 
GeneralRe: Running console apps on windows 7 Pin
CalinNegru(fearless_)23-Feb-20 21:22
MemberCalinNegru(fearless_)23-Feb-20 21:22 
AnswerRe: Running console apps on windows 7 Pin
Richard MacCutchan23-Feb-20 20:59
mveRichard MacCutchan23-Feb-20 20:59 
GeneralRe: Running console apps on windows 7 Pin
CalinNegru(fearless_)23-Feb-20 21:21
MemberCalinNegru(fearless_)23-Feb-20 21:21 
GeneralRe: Running console apps on windows 7 Pin
jsc4229-Feb-20 11:16
professionaljsc4229-Feb-20 11:16 
Questiongetting started with ASM, what compilers do you use? Pin
CalinNegru(fearless_)21-Feb-20 1:47
MemberCalinNegru(fearless_)21-Feb-20 1:47 
AnswerRe: getting started with ASM, what compilers do you use? Pin
Richard MacCutchan21-Feb-20 1:52
mveRichard MacCutchan21-Feb-20 1:52 
GeneralRe: getting started with ASM, what compilers do you use? Pin
CalinNegru(fearless_)21-Feb-20 2:40
MemberCalinNegru(fearless_)21-Feb-20 2:40 
GeneralRe: getting started with ASM, what compilers do you use? Pin
Richard MacCutchan21-Feb-20 3:54
mveRichard MacCutchan21-Feb-20 3:54 
GeneralRe: getting started with ASM, what compilers do you use? Pin
CalinNegru(fearless_)21-Feb-20 6:39
MemberCalinNegru(fearless_)21-Feb-20 6:39 
GeneralRe: getting started with ASM, what compilers do you use? Pin
Richard MacCutchan21-Feb-20 6:50
mveRichard MacCutchan21-Feb-20 6:50 
GeneralRe: getting started with ASM, what compilers do you use? Pin
CalinNegru(fearless_)21-Feb-20 7:04
MemberCalinNegru(fearless_)21-Feb-20 7:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.