From: Brian Candler Date: 2007-08-15T18:39:10+09:00 Subject: Re: IO#seek and whence problem On Wed, Aug 15, 2007 at 05:38:38PM +0900, Bertram Scharpf wrote: > I completely turned off optimization and distcc. > > In I put the following debug statements: > > static VALUE > rb_io_seek(io, offset, whence) > VALUE io, offset; > int whence; > { > OpenFile *fptr; > off_t pos; > > fprintf( stderr, "rb_io_seek: A; whence=%d\n", pos, whence); Two arguments, one format specifier? > pos = NUM2OFFT(offset); > fprintf( stderr, "rb_io_seek: B; pos=%d, whence=%d\n", pos, whence); Remember that %d consumes an 'int', and off_t may be larger than int on your platform. This is safer: fprintf( stderr, "rb_io_seek: B; pos=%ld, whence=%d\n", (long)pos, whence);