In my example, a should have been initialized to 0 to make the result non-obvious. Sorry. -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of PICLIST Sent: Saturday, May 03, 2014 12:42 PM To: 'Microcontroller discussion list - Public.' Subject: RE: [OT] Why on earth??!? As an experienced, but certainly not expert, C programmer - I have a few tens of thousands of lines of C and C++ behind me, and more in other languages. Unfortunately my experience is spread out over too many languages, years, platforms and compilers. I tend to believe in always turning on all compiler warnings and write my code to avoid all of the warnings. The code ends up a bit longer, but fixin= g warnings has saved me from hours of debugging many times. The warnings usually tell you when you are playing around in the less obvious areas of the language. I am then forced to code in an obvious fashion so there is no question of what I want. In the current signed vs unsigned discussion, I would be forced to add an explicit cast to "int" or "unsigned int" depending on what I wanted. The cast makes the intention clear and reminds me in the future that the code i= s dealing with unlike types. In fact it makes me think about the possibilitie= s for error in what I am doing. In the current example for instance: Am I sur= e the int will never have a value greater than 16384? Another example where the warnings are very useful is the "=3D" vs "=3D=3D" operators: It is valid C (and maybe even intentional) to code the following: // b ends up as 2! int a=3D1; int b=3D1; if (a=3Db) { b=3D2; }; In most cases this will generate a warning about using the assignment "=3D" operator in an if, instead of the more common logical "=3D=3D" comparison operator. The warning saves me from having to debug the problem because of = a typo. If I had really meant to do that, I would code: if (0 !=3D (a=3Db) { b=3D2; }; Or more clearly: a=3Db; if (a) { b=3D2; }; I even put in the extra () in the first case to be clear on what operator precedence I desire, since the precedence of =3D vs =3D=3D is not necessari= ly obvious. Many people hate doing things like "=3D=3D 0" or "!=3D 0" in an if= , since that is what the if does anyway, but any decent compiler will create the same code, and the clarity of specifying the "=3D=3D 0" if often worth the = extra few characters. C can be a master of obfuscation. Obfuscation is certainly not the best route to bug-free code. My favourite example is: #include main(t,_,a) char *a; { return!0