Philippe Mathieu-Daudé <phi...@redhat.com> writes: [...] > The related question is, is it OK to use size_t to iterate over an array? > > for (size_t i = 0; i < ARRAY_SIZE(array); i++) { > ... > }
My rule of thumb on integer types is "whatever lets me avoid not-obviously-safe conversions (implicit ones in particular) with the least type cast clutter. Quite often, int fits the bill. But not always. To reply to your example: depends on what's hiding in the ... :) > Asking in this thread so we can modify CODING_STYLE accordingly :)