Kurt Roeckx <[EMAIL PROTECTED]> wrote:
> > I applied these and zelously went through and made sure everything
> > in those files is type-safe. Now the result isn't releaseable on 32-bit
> > platforms, it compiles fine, but it's causing segmentation faults after a
> > few minutes of operation. :-/
> I don't think the changes made to the printf()'s are causing
> segfaults. I'm guessing some other changes where made.
I changed the types of some variables along the way and converted as
much as I could to use PRI's instead of straight formatting codes. Like I
said, I got zealous about it. :)
> So, I still get those:
Cool, I'll have a look at those tonight. Thanks, I'm learning a lot
from this. :)
- Tyler
> bt_metainfo.c: In function 'load_metainfo':
> bt_metainfo.c:45: warning: format '%llu' expects type 'long long unsigned
> int', but argument 4 has type '__off_t'
> bt_metainfo.c:66: warning: format '%llu' expects type 'long long unsigned
> int', but argument 3 has type '__off_t'
> bt_metainfo.c:74: warning: format '%llu' expects type 'long long unsigned
> int', but argument 4 has type '__off_t'
>
> Which where the off_t problem. I had changed those to %zu, but I
> assume that didn't work out on 32 bit.
>
> And this seems to be new:
> btt_tracker_alloc.c: In function 'shmem_filename':
> btt_tracker_alloc.c:42: warning: format '%ld' expects type 'long int', but
> argument 5 has type 'int'
> btt_tracker_alloc.c:42: warning: format '%ld' expects type 'long int', but
> argument 6 has type 'int'
>
> len is an int, and so since BT_FILE_LEN is a constant, so is the
> last argument. I suggest you just change thsoe to "%d".
>
> Then there is:
> btt_peer.c: In function 'btt_peer2bencode':
> btt_peer.c:274: warning: format '%u' expects type 'unsigned int', but
> argument 3 has type 'size_t'
>
> and a size_t requires %zu.
>
> Then we get:
> Tracker.xs: In function 'XS_Net__BitTorrent__LibBT__Tracker_Infohash':
> Tracker.xs:580: warning: format '%zu' expects type 'size_t', but argument 4
> has type 'int'
> Tracker.xs: In function 'XS_Net__BitTorrent__LibBT__Tracker__Infohash_Peer':
> Tracker.xs:1051: warning: format '%zu' expects type 'size_t', but argument 4
> has type 'int'
>
> The len has the correct %zu, but BT_INFOHASH_LEN and
> BT_PEERID_LEN are only an int.
>
> That was it.
>
>
> Kurt
>
--
Tank will collaboratively market mission-critical appliances.