From: Marc Haisenko Date: 2006-09-11T16:58:27+09:00 Subject: Re: Segfault in libc strlen, via rb_str_new2 On Sunday 10 September 2006 22:57, Eric Hodel wrote: > On Sep 9, 2006, at 7:16 PM, Sean E. Russell wrote: > > Hmm. My C is rusty, but I didn't think there was any difference > > between a > > pointer and an integer on 32-bit x86. > > I don't have one of those (PPC G4). It is very likely that you'll > run into a platform where this will matter, so your code should be > correct. Yes, for example AMD64: sizeof(int) == 4, sizeof(void*) == 8 One is NEVER allowed to assume that a pointer can be stored in an arithmetic value, e.g. it's possible that on some architecture arithmetic values are 32 bit and pointers are 36 bit (IIRC there is an architecture where this is really true). -- Marc Haisenko Comdasys AG R�desheimer Stra�e 7 D-80686 M�nchen Tel: � +49 (0)89 - 548 43 33 21 Fax: � +49 (0)89 - 548 43 33 29 e-mail: haisenko@comdasys.com http://www.comdasys.com