error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
maikebing opened this issue · 5 comments
maikebing commented
../../../libqb.cpp: In function ‘list* list_new(int32_t)’:
../../../libqb.cpp:505:39: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
L->structure_base[1]=(ptrszint)L->structure;
^~~~~~~~~
../../../libqb.cpp: In function ‘int32_t list_add(list*)’:
../../../libqb.cpp:542:66: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
L->structure_base[++L->structure_bases]=(ptrszint)L->structure;
^~~~~~~~~
../../../libqb.cpp:554:95: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
L->index[i]=(ptrszint)( L->structure + (L->internal_structure_size*L->structures) );
^
../../../libqb.cpp:557:95: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
L->index[i]=(ptrszint)( L->structure + (L->internal_structure_size*L->structures) );
^
../../../libqb.cpp: In function ‘void free_mem_lock(mem_lock*)’:
../../../libqb.cpp:1250:50: error: cast from ‘mem_lock*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
mem_lock_freed[mem_lock_freed_n++]=(ptrszint)lock;
^~~~
../../../libqb.cpp: In function ‘void qbs_free_descriptor(qbs*)’:
../../../libqb.cpp:5873:54: error: cast from ‘qbs*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
qbs_malloc_freed[qbs_malloc_freed_num]=(ptrszint)str;
^~~
../../../libqb.cpp: In function ‘void qbs_cmem_concat_list()’:
../../../libqb.cpp:5946:44: error: cast from ‘qbs*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
qbs_cmem_list[d]=(ptrszint)tqbs;
^~~~
../../../libqb.cpp: In function ‘void qbs_concat_list()’:
../../../libqb.cpp:5971:39: error: cast from ‘qbs*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
qbs_list[d]=(ptrszint)tqbs;
^~~~
../../../libqb.cpp: In function ‘void qbs_concat_cmem(uint32_t)’:
../../../libqb.cpp:6053:144: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
if (tqbs->cmem_descriptor){tqbs->cmem_descriptor[0]=tqbs->len; tqbs->cmem_descriptor[1]=(uint16)(ptrszint)(tqbs->chr-dblock);}
^
../../../libqb.cpp: In function ‘qbs* qbs_new_cmem(int32_t, uint8_t)’:
../../../libqb.cpp:6074:79: error: cast from ‘qbs*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
newstr->listi=qbs_cmem_list_nexti; qbs_cmem_list[newstr->listi]=(ptrszint)newstr; qbs_cmem_list_nexti++;
^~~~~~
../../../libqb.cpp:6077:87: error: cast from ‘qbs*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
newstr->tmplisti=qbs_tmp_list_nexti; qbs_tmp_list[newstr->tmplisti]=(ptrszint)newstr; qbs_tmp_list_nexti++;
^~~~~~
../../../libqb.cpp:6084:113: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
newstr->cmem_descriptor[0]=newstr->len; newstr->cmem_descriptor[1]=(uint16)(ptrszint)(newstr->chr-dblock);
^
../../../libqb.cpp: In function ‘qbs* qbs_new_txt(const char*)’:
../../../libqb.cpp:6101:83: error: cast from ‘qbs*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
newstr->tmplisti=qbs_tmp_list_nexti; qbs_tmp_list[newstr->tmplisti]=(ptrszint)newstr; qbs_tmp_list_nexti++;
^~~~~~
../../../libqb.cpp: In function ‘qbs* qbs_new_txt_len(const char*, int32_t)’:
../../../libqb.cpp:6113:83: error: cast from ‘qbs*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
newstr->tmplisti=qbs_tmp_list_nexti; qbs_tmp_list[newstr->tmplisti]=(ptrszint)newstr; qbs_tmp_list_nexti++;
^~~~~~
../../../libqb.cpp: In function ‘qbs* qbs_new_fixed(uint8_t*, uint32_t, uint8_t)’:
../../../libqb.cpp:6134:87: error: cast from ‘qbs*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
newstr->tmplisti=qbs_tmp_list_nexti; qbs_tmp_list[newstr->tmplisti]=(ptrszint)newstr; qbs_tmp_list_nexti++;
^~~~~~
../../../libqb.cpp:6143:117: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
newstr->cmem_descriptor[0]=newstr->len; newstr->cmem_descriptor[1]=(uint16)(ptrszint)(newstr->chr-dblock);
^
../../../libqb.cpp: In function ‘qbs* qbs_new(int32_t, uint8_t)’:
../../../libqb.cpp:6157:69: error: cast from ‘qbs*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
newstr->listi=qbs_list_nexti; qbs_list[newstr->listi]=(ptrszint)newstr; qbs_list_nexti++;
^~~~~~
../../../libqb.cpp:6160:87: error: cast from ‘qbs*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
newstr->tmplisti=qbs_tmp_list_nexti; qbs_tmp_list[newstr->tmplisti]=(ptrszint)newstr; qbs_tmp_list_nexti++;
^~~~~~
../../../libqb.cpp: In function ‘void qbs_maketmp(qbs*)’:
../../../libqb.cpp:6169:77: error: cast from ‘qbs*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
str->tmplisti=qbs_tmp_list_nexti; qbs_tmp_list[str->tmplisti]=(ptrszint)str; qbs_tmp_list_nexti++;
^~~
../../../libqb.cpp: In function ‘qbs* qbs_set(qbs*, qbs*)’:
../../../libqb.cpp:6196:64: error: cast from ‘qbs*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
qbs_cmem_list[srcstr->listi]=(ptrszint)deststr;
^~~~~~~
../../../libqb.cpp:6201:59: error: cast from ‘qbs*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
qbs_list[srcstr->listi]=(ptrszint)deststr;
^~~~~~~
../../../libqb.cpp:6212:159: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
if (deststr->cmem_descriptor){deststr->cmem_descriptor[0]=deststr->len; deststr->cmem_descriptor[1]=(uint16)(ptrszint)(deststr->chr-dblock);}
^
../../../libqb.cpp:6226:49: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
if (((ptrszint)deststr->chr+srcstr->len)<=(dblock+cmem_sp)){//space available
^~~
../../../libqb.cpp:6229:61: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
qbs_cmem_sp=((ptrszint)deststr->chr)+(ptrszint)deststr->len-dblock;
^~~
../../../libqb.cpp:6252:45: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
if (((ptrszint)deststr->chr+srcstr->len)<=(dblock+cmem_sp)){//space available
^~~
../../../libqb.cpp:6255:57: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
qbs_cmem_sp=((ptrszint)deststr->chr)+(ptrszint)deststr->len-dblock;
^~~
../../../libqb.cpp:6267:66: error: cast from ‘qbs*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
qbs_cmem_list[qbs_cmem_list_nexti]=(ptrszint)deststr; qbs_cmem_list_nexti++; //relist
^~~~~~~
../../../libqb.cpp:6278:45: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
if (((ptrszint)deststr->chr+srcstr->len)<=((ptrszint)qbs_data+qbs_data_size)){//space available
^~~
../../../libqb.cpp:6278:74: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
if (((ptrszint)deststr->chr+srcstr->len)<=((ptrszint)qbs_data+qbs_data_size)){//space available
^~~~~~~~
../../../libqb.cpp:6281:52: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
qbs_sp=((ptrszint)deststr->chr)+(ptrszint)deststr->len-(ptrszint)qbs_data;
^~~
../../../libqb.cpp:6281:90: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
qbs_sp=((ptrszint)deststr->chr)+(ptrszint)deststr->len-(ptrszint)qbs_data;
^~~~~~~~
../../../libqb.cpp:6305:41: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
if (((ptrszint)deststr->chr+srcstr->len)<=((ptrszint)qbs_data+qbs_data_size)){//space available
^~~
../../../libqb.cpp:6305:70: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
if (((ptrszint)deststr->chr+srcstr->len)<=((ptrszint)qbs_data+qbs_data_size)){//space available
^~~~~~~~
../../../libqb.cpp:6308:48: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
qbs_sp=((ptrszint)deststr->chr)+(ptrszint)deststr->len-(ptrszint)qbs_data;
^~~
../../../libqb.cpp:6308:86: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
qbs_sp=((ptrszint)deststr->chr)+(ptrszint)deststr->len-(ptrszint)qbs_data;
^~~~~~~~
../../../libqb.cpp:6321:52: error: cast from ‘qbs*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
qbs_list[qbs_list_nexti]=(ptrszint)deststr; qbs_list_nexti++; //relist
^~~~~~~
../../../libqb.cpp:6334:155: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
if (deststr->cmem_descriptor){deststr->cmem_descriptor[0]=deststr->len; deststr->cmem_descriptor[1]=(uint16)(ptrszint)(deststr->chr-dblock);}
^
../../../libqb.cpp: In function ‘int32_t connection_new(int32_t, qbs*, int32_t)’:
../../../libqb.cpp:22053:55: error: cast from ‘stream_struct*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
my_handle_struct->index=(ptrszint)my_stream_struct;
^~~~~~~~~~~~~~~~
../../../libqb.cpp:22055:55: error: cast from ‘connection_struct*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
my_stream_struct->index=(ptrszint)my_connection_struct;
^~~~~~~~~~~~~~~~~~~~
../../../libqb.cpp:22081:55: error: cast from ‘connection_struct*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
my_handle_struct->index=(ptrszint)my_connection_struct;
^~~~~~~~~~~~~~~~~~~~
../../../libqb.cpp:22106:51: error: cast from ‘stream_struct*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
my_handle_struct->index=(ptrszint)my_stream_struct;
^~~~~~~~~~~~~~~~
../../../libqb.cpp:22108:51: error: cast from ‘connection_struct*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
my_stream_struct->index=(ptrszint)my_connection_struct;
^~~~~~~~~~~~~~~~~~~~
../../../libqb.cpp: In function ‘mem_block func__mem_at_offset(int32_t, int32_t)’:
../../../libqb.cpp:26339:37: error: cast from ‘mem_lock*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
b.lock_offset=(ptrszint)mem_lock_tmp; b.lock_id=mem_lock_id;
^~~~~~~~~~~~
../../../libqb.cpp: In function ‘mem_block func__memnew(int32_t)’:
../../../libqb.cpp:26357:37: error: cast from ‘mem_lock*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
b.lock_offset=(ptrszint)mem_lock_tmp;
^~~~~~~~~~~~
../../../libqb.cpp:26381:52: error: cast from ‘void*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
b.offset=(ptrszint)malloc(bytes);
^
../../../libqb.cpp: In function ‘mem_block func__memimage(int32_t, int32_t)’:
../../../libqb.cpp:26414:45: error: cast from ‘void*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
b.lock_offset=(ptrszint)im->lock_offset; b.lock_id=im->lock_id;//get existing tag
^~~~~~~~~~~
../../../libqb.cpp:26418:41: error: cast from ‘mem_lock*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
b.lock_offset=(ptrszint)mem_lock_tmp; b.lock_id=mem_lock_id;
^~~~~~~~~~~~
../../../libqb.cpp:26422:36: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
b.offset=(ptrszint)im->offset;
^~~~~~
../../../libqb.cpp:26432:37: error: cast from ‘mem_lock*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
b.lock_offset=(ptrszint)mem_lock_base; b.lock_id=1073741821;//set invalid lock
^~~~~~~~~~~~~
../../../libqb.cpp: In function ‘void sub__memfill_1(mem_block*, int32_t, int32_t, int8_t)’:
../../../libqb.cpp:26491:54: error: cast from ‘int8_t*’ {aka ‘signed char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
sub__memfill(dblk,doff,dbytes,(ptrszint)&val,1);
^~~
../../../libqb.cpp: In function ‘void sub__memfill_nochecks_1(int32_t, int32_t, int8_t)’:
../../../libqb.cpp:26494:58: error: cast from ‘int8_t*’ {aka ‘signed char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
sub__memfill_nochecks(doff,dbytes,(ptrszint)&val,1);
^~~
../../../libqb.cpp: In function ‘void sub__memfill_2(mem_block*, int32_t, int32_t, int16_t)’:
../../../libqb.cpp:26497:54: error: cast from ‘int16_t*’ {aka ‘short int*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
sub__memfill(dblk,doff,dbytes,(ptrszint)&val,2);
^~~
../../../libqb.cpp: In function ‘void sub__memfill_nochecks_2(int32_t, int32_t, int16_t)’:
../../../libqb.cpp:26500:58: error: cast from ‘int16_t*’ {aka ‘short int*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
sub__memfill_nochecks(doff,dbytes,(ptrszint)&val,2);
^~~
../../../libqb.cpp: In function ‘void sub__memfill_4(mem_block*, int32_t, int32_t, int32_t)’:
../../../libqb.cpp:26503:54: error: cast from ‘int32_t*’ {aka ‘int*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
sub__memfill(dblk,doff,dbytes,(ptrszint)&val,4);
^~~
../../../libqb.cpp: In function ‘void sub__memfill_nochecks_4(int32_t, int32_t, int32_t)’:
../../../libqb.cpp:26506:58: error: cast from ‘int32_t*’ {aka ‘int*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
sub__memfill_nochecks(doff,dbytes,(ptrszint)&val,4);
^~~
../../../libqb.cpp: In function ‘void sub__memfill_8(mem_block*, int32_t, int32_t, int64_t)’:
../../../libqb.cpp:26509:54: error: cast from ‘int64_t*’ {aka ‘long int*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
sub__memfill(dblk,doff,dbytes,(ptrszint)&val,8);
^~~
../../../libqb.cpp: In function ‘void sub__memfill_nochecks_8(int32_t, int32_t, int64_t)’:
../../../libqb.cpp:26512:58: error: cast from ‘int64_t*’ {aka ‘long int*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
sub__memfill_nochecks(doff,dbytes,(ptrszint)&val,8);
^~~
../../../libqb.cpp: In function ‘void sub__memfill_SINGLE(mem_block*, int32_t, int32_t, float)’:
../../../libqb.cpp:26515:54: error: cast from ‘float*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
sub__memfill(dblk,doff,dbytes,(ptrszint)&val,4);
^~~
../../../libqb.cpp: In function ‘void sub__memfill_nochecks_SINGLE(int32_t, int32_t, float)’:
../../../libqb.cpp:26518:58: error: cast from ‘float*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
sub__memfill_nochecks(doff,dbytes,(ptrszint)&val,4);
^~~
../../../libqb.cpp: In function ‘void sub__memfill_DOUBLE(mem_block*, int32_t, int32_t, double)’:
../../../libqb.cpp:26521:54: error: cast from ‘double*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
sub__memfill(dblk,doff,dbytes,(ptrszint)&val,8);
^~~
../../../libqb.cpp: In function ‘void sub__memfill_nochecks_DOUBLE(int32_t, int32_t, double)’:
../../../libqb.cpp:26524:58: error: cast from ‘double*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
sub__memfill_nochecks(doff,dbytes,(ptrszint)&val,8);
^~~
../../../libqb.cpp: In function ‘void sub__memfill_FLOAT(mem_block*, int32_t, int32_t, long double)’:
../../../libqb.cpp:26530:53: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
sub__memfill(dblk,doff,dbytes,(ptrszint)memfill_FLOAT_padding,32);
^~~~~~~~~~~~~~~~~~~~~
../../../libqb.cpp: In function ‘void sub__memfill_nochecks_FLOAT(int32_t, int32_t, long double)’:
../../../libqb.cpp:26534:57: error: cast from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
sub__memfill_nochecks(doff,dbytes,(ptrszint)memfill_FLOAT_padding,32);
^~~~~~~~~~~~~~~~~~~~~
../../../libqb.cpp: In function ‘void sub__memfill_OFFSET(mem_block*, int32_t, int32_t, int32_t)’:
../../../libqb.cpp:26538:54: error: cast from ‘int32_t*’ {aka ‘int*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
sub__memfill(dblk,doff,dbytes,(ptrszint)&val,sizeof(ptrszint));
^~~
../../../libqb.cpp: In function ‘void sub__memfill_nochecks_OFFSET(int32_t, int32_t, int32_t)’:
../../../libqb.cpp:26541:58: error: cast from ‘int32_t*’ {aka ‘int*’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
sub__memfill_nochecks(doff,dbytes,(ptrszint)&val,sizeof(ptrszint));
^~~
../../../libqb.cpp: In function ‘mem_block func__mem(int32_t, int32_t, int32_t, int32_t, mem_lock*)’:
../../../libqb.cpp:26605:37: error: cast from ‘mem_lock*’ to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
b.lock_offset=(ptrszint)lock; b.lock_id=lock->id;
^~~~
../../../libqb.cpp: In function ‘int main(int, char**)’:
../../../libqb.cpp:27483:23: error: cast from ‘uint8_t (*)[1114099]’ {aka ‘unsigned char (*)[1114099]’} to ‘int32_t’ {aka ‘int’} loses precision [-fpermissive]
dblock=(ptrszint)&cmem+1280;//0:500h
aouwt commented
Can you post more information? What version of QB64 is this? What program are you trying to compile? What OS are you running?
maikebing commented
QB64 is new version ,
gcc version 8.3.0 (Debian 8.3.0-6.lnd.vec.23)
Linux version 4.19.0
maikebing commented
I've added -fpermissive to the compilation parameters , compiled successfully. However, a Segmentation fault occurred.
maikebing commented
gdb bt info
#0 0x00000001206db5dc in list_get(list*, int) ()
#1 0x0000000120767190 in main ()
aouwt commented
QB64 is new version , gcc version 8.3.0 (Debian 8.3.0-6.lnd.vec.23) Linux version 4.19.0
is it the development build, from the git, or stable?