On Wed, Aug 06, 2014 at 10:22:10AM -0400, crespin wrote:
Hello,
nevents is an ngx_int_t, so the print format must be “%i”.
Both signed and unsigned ngx_[u]int_t has the same size, so that’s
more about preferable representation of numbers, not about
correctness of the code.
In this particular case I think that %ui is better, as negative
numbers shouldn’t be here, and logging them with %ui will make
them clearly visible as very big positive numbers. It’s also what
will be used in the actual poll() syscall.
For future reference, please also take a look at the following
link:
Yes, %d here is certainly incorrect, as int and ngx_int_t sizes
may differ. I don’t think there are any platforms with poll()
where this may cause problems, but nevertheless it’s worth fixing.
Changing this to %ui should be ok.
Committed with commit log modified to match style we use, and
combined with other format specifier fixes from your other patch
(as well as a couple of fixes in the select module).
Yes, %d here is certainly incorrect, as int and ngx_int_t sizes
may differ. I don’t think there are any platforms with poll()
where this may cause problems, but nevertheless it’s worth fixing.
Changing this to %ui should be ok.