Re: NNTPC: stats bug fixed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mike Wade <mwade@cdc.net> writes:

> On 5 Jun 1998, Hugo Embrechts wrote:
> 
> > The introduction of 64 bit counters (type big_t) in nntpcache 2.3.2.1
> > makes the stats printing code architecture dependant.
> 
> Apparently there are more of these problems, example in 'nocem.c':
> 
> log (("group '%s' yeilded %d articles, %d new %s msgid's and %d
>    duplicates (already classified msgid's)", group, st->art_good -
>    st2.art_good, st->msgid_good - st2.msgid_good, SPAM, st->msgid_dup -
>    st2.msgid_dup));
> 
> art_good, msgid_good, and msgid_dup are all of type 'big_t'

Right. But they are never naked (at least in this example). The hope
here is that they will be demoted to ints after subtraction. This hope
seems to payoff under gcc - but then gcc has a tightly integrated type
checking (and thus presumably demoting) interface to *printf. It might
be worth while force casting these back to ints after subtraction, or
using bigToStr() (from src/http.c). The problem with the latter method
is that printf isn't a lazy evaluator and bigToStr uses static
buffers. Has anyone actually had a problem with the above code?

Cheers,
Julian.


[Index of Archives]     [Yosemite]     [Yosemite Campsites]     [Bugtraq]     [Linux]     [Trn]

Powered by Linux