Closed p5pRT closed 20 years ago
making perl5.5.64 with threads gave gcc warnings:
sv.c: In function `Perl_ptr_table_fetch': sv.c:6401: warning: cast from pointer to integer of different size sv.c: In function `Perl_ptr_table_store': sv.c:6418: warning: cast from pointer to integer of different size sv.c: In function `Perl_ptr_table_split': sv.c:6458: warning: cast from pointer to integer of different size make: [extra.pods] Error 1 (ignored) ODBM_File.c: In function `XS_ODBM_File_TIEHASH': ODBM_File.c:92: warning: passing arg 1 of `Perl_Gcurinterp_ptr' from incompatible pointer type ODBM_File.c:92: warning: passing arg 1 of `Perl_Gcurinterp_ptr' from incompatible pointer type ODBM_File.c:92: warning: passing arg 1 of `Perl_Gcurinterp_ptr' from incompatible pointer type [snipped]
Thread.xs:25: warning: `struct perl_thread' declared inside parameter list Thread.xs:25: warning: its scope is only this definition or declaration\, which is probably not what you want.
The patch below fixes the problems in sv.c and ODBM_File.c. I am happy with the patches to sv.c but less happy with what I have done to ODBM_File.xs. I have not managed to fix the Thread.xs errors.
I also get warnings from Configure: \<poll.h> found. Guessing which symbols your C compiler and preprocessor define... :2: warning: `#ifdef' argument starts with a digit :7: warning: `#ifdef' argument starts with a digit tcsetattr() found.
Robin
--- sv.c 2000/02/04 12:11:32 1.1 +++ sv.c 2000/02/04 12:13:55 @@ -6398\,7 +6398\,7 @@ Perl_ptr_table_fetch(pTHX_ PTR_TBL_t *tbl\, void *sv) { PTR_TBL_ENT_t *tblent; - UV hash = (UV)sv; + UV hash = PTR2UV(sv); assert(tbl); tblent = tbl->tbl_ary[hash & tbl->tbl_max]; for (; tblent; tblent = tblent->next) { @@ -6415\,7 +6415\,7 @@ /* XXX this may be pessimal on platforms where pointers aren't good * hash values e.g. if they grow faster in the most significant * bits */ - UV hash = (UV)oldv; + UV hash = PTR2UV(oldv); bool i = 1;
assert(tbl); @@ -6455\,7 +6455\,7 @@ continue; curentp = ary + oldsize; for (entp = ary\, ent = *ary; ent; ent = *entp) { - if ((newsize & (UV)ent->oldval) != i) { + if ((newsize & PTR2UV(ent->oldval)) != i) { *entp = ent->next; ent->next = *curentp; *curentp = ent; --- ext/ODBM_File/ODBM_File.xs 2000/02/04 12:55:36 1.1 +++ ext/ODBM_File/ODBM_File.xs 2000/02/04 12:56:01 @@ -2\,9 +2\,6 @@ #include "perl.h" #include "XSUB.h"
-#ifdef NULL -#undef NULL /* XXX Why? */ -#endif #Ifdef I_DBM # include \<dbm.h> #else
Migrated from rt.perl.org#2099 (status was 'resolved')
Searchable as RT2099$