Not to resurrect an old thread or anything, but this is a very interesting discussion. I have recently begun to make heavy use of the Arduino libraries, and have been noticing a number of compiler warnings in v1.0.5. I started out with the Arduino IDE, but have now configured Eclipse to provide a more robust development environment. This makes it easier to investigate the various compiler warnings, as all you have to do is to click on them to open the appropriate file directly. So in searching for some of these warnings I ran across this thread, and think it's an excellent discussion. Basically, I am somewhat amazed at a few of these warnings actually...as in, why are they even still there. In one case there was a "compared signed to unsigned int" warning, and it was quite ironic actually as the code went something like this:
int i = (unsigned int)(foo + 1) % SOME_VALUE;
...and then they tried to compare i' to another unsigned integer a few lines down. So I simply made 'i' an unsigned integer in the first place, and that was that.
But I have to wonder...how does something like this NOT get fixed? Why are simple little things like this left in the core Arduino library? I mean, the hover-help in Eclipse confirms what the compiler warned me about--that the thing being compared to "int i" is indeed an unsigned integer. So doesn't stuff like this give Arduino a bit of a black eye, in some ways? And there are also numerous instances of unused variables being scattered around various files, so I've been going through and removing those to resolve warnings where needed.
Anyway, I'll just fix these things were needed--and then build a "clean" version of the Arduino core libraries for my projects. But I just thought this issue was worthy of mention, simply due to the fact that (like has been pointed out here) it is quite a simple matter to resolve these things in the first place. But if you use the Arduino IDE, I think the tendency is to not even pay attention to stuff like that. For one thing the verbose compiler output isn't enabled by default (it wasn't in my IDE anyway), so you really have to know to go looking for that feature. Then the default compiler output window is so small (narrow) by default that any orange text messages fly by so quickly that most people probably aren't even going to notice them...much less go back and look at what they represent. This is just another reason why I like using a higher-powered IDE, and given the fact that it's so cross-platform, I have really been liking Eclipse for my work of late.
Now if I could only figure out the proper AVRDude settings for the Mega2560, I could get that bit working in Eclipse and I'd be off to the races. For some reason the settings hinted at in the boards.txt file don't result in a successful upload. Then I managed to hose one of the fuses in my Mega and had to spend 3-4 hours getting that reset with an ISP...lol. Needless to say, there have been LOTS of "learning opportunities" for me lately!
TB