Μια του κλέφτη, δύο του κλέφτη, τρεις και ... "βεντούζα"! Πάρτε να έχετε!
Αδιάφοροι και υπερόπτες!
Τρίτη, Οκτωβρίου 27, 2009
Τετάρτη, Οκτωβρίου 21, 2009
Πάμε γερά
Πέμπτη, Οκτωβρίου 15, 2009
From 32bit to 64bit: void* to int gcc error
Yesterday I encountered the following problem. I was writing a program on a 32bit OS (Linux) and then I tried to compile the same source code on a 64bit Linux. The compilation failed because:
error: cast from ‘void*’ to ‘int’ loses precision
The reason: On 32bit compatible processors void* and int have the same size (32bit) but on 64bit ones void* is 64 bits and int 32 bits long.
The solution: Cast void* to long int.
Source:
http://seokjoon.springnote.com/pages/1688622.xhtml
error: cast from ‘void*’ to ‘int’ loses precision
The reason: On 32bit compatible processors void* and int have the same size (32bit) but on 64bit ones void* is 64 bits and int 32 bits long.
The solution: Cast void* to long int.
Source:
http://seokjoon.springnote.com/pages/1688622.xhtml
Ετικέτες
C/C++,
programming
Εγγραφή σε:
Αναρτήσεις (Atom)