Zach Welch <z...@superlucidity.net> writes: > On Wed, 2009-11-11 at 08:40 +0100, Øyvind Harboe wrote: >> I've read over the branch and improving types is always a good thing, >> even if I don't have a specific opinions on whether to use >> unsigned or int for iteration variables, etc. > > There is almost always a correct choice. Most of the time, there is not > really any opinion about it. There is correct and less-than-so. I mean > really... this started with the annoyance of argc being 'int' rather > than 'unsigned'. One can never have less than zero arguments, so.... > > IIRC, the fact that main() expects an 'int' reflects C's long legacy. > There were too many out-of-tree users to worry about breaking things by > the time unsigned came about, and so it was and shall ever be.... > We can right such wrongs before we reach 1.0 and avoid suffering similar > regrets in our future.
I'm not sure this opinion is held generally? I use "unsigned" when I need it - basically for bitmaps or when you need the guaranteed rollover behaviour like with timers. Are you sure you are not going to end up with gratuitous "unsigned"s or casts propagating everywhere as you try to fix the warnings? Most of the C library functions use ints, not just main. [...] -- John Devereux _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development