On Sun, Aug 08, 2004 at 10:46:20AM -0700, Jarkko Hietaniemi wrote: > # New Ticket Created by Jarkko Hietaniemi > # Please include the string: [perl #30995] > # in the subject line of all future correspondence about this issue. > # <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=30995 > > > > Anyone who thinks sizeof(int) == sizeof(long) == sizeof(*) > should now as a penance run ten times around the building, backwards. > Anyone who thinks one can dereference unaligned pointers must do twenty. > Anyone who thinks that C char is always signed should do five.
The should be sentanced to 5 years hard Unicos. :-) > > The unmanagedstruct tried to dereference unaligned pointers. > > (a) in unmanagedstruct.pmc fixed ret_int to align properly (the main > thing was to separate INTVAL and int cases, but I added some other > types while I was at it) > (b) config.h.in: added SHORT_SIZE and INT_SIZE to support (a) > (c) nci.t: the test assumed that (char)(3*64) would be -64 and therefore > explicitly abs()ed the result - that the result would be 192 was not > expected at all. Odd. How come it doesn't fail on OS X, where char is unsigned too? > (d) pdd16_native_call.pod: added a note about signedness of the C char. > Not that anyone ever reads documentation. With patch I'm down to 2 failures on 64 bit Sparc Solaris. Previously test hang burning CPU at 8/34. Now we have: $ /export/home/nick/Sandpit/maint-64all22989/bin/perl5.8.4 -Ilib t/pmc/nci.t 1..34 ok 1 - nci_d_d ok 2 - nci_d_d - PIR ok 3 - nci_f_ff ok 4 - nci_i_sc ok 5 - nci_s_sc ok 6 - nci_c_sc ok 7 - nci_i_t ok 8 - nci_t_t ok 9 - nci_d_d - stress test ok 10 - nci_d_d - clone ok 11 - nci_i_iii ok 12 - nci_i_4i not ok 13 - nci_i_i3 # Failed test (t/pmc/nci.t at line 376) # got: '0 # 20233590931463 # ' # expected: '42 # 4711 # ' ok 14 - nci_t_b ok 15 - nci_t_B ok 16 - nci_p_i ok 17 - nci_p_i ok 18 - nci_p_i - align ok 19 - nci_p_i - char* ok 20 - nci_p_i - nested struct * ok 21 - nci_p_i - nested struct * w named access ok 22 - nci_p_i - func_ptr* with signature ok 23 - nci_p_i - nested struct aligned ok 24 - nci_p_i - nested struct unaligned ok 25 - nci_p_i - nested, unaligned, named ok 26 - nci_i_p ok 27 - nci_v_P ok 28 - nci_cb_C1 ok 29 - nci_cb_D1 ok 30 - nci_cb_C2 ok 31 - array of structs not ok 32 - out parameters and return values # Failed test (t/pmc/nci.t at line 1168) # got: 'Double: 3 # Triple: 2 # Sum: 0 # ' # expected: 'Double: 6 # Triple: 6 # Sum: 12 # ' ok 33 - nested structs ok 34 - nested array in a struct # Looks like you failed 2 tests of 34. I'll have a look tonight at the cause. Nicholas Clark