> I hate how GCC "suggests" adding parenthesis around mixed operators with > "ambiguous" precedence, and also for ambiguous if/else. > It turns out that there's nothing ambiguous in the operator precedence > or if/else in C. >=20 > For instance: >=20 > if( a ) > if( b ) > ... > else > ... >=20 > It's obvious that the "else" belongs to the second "if", but GCC issues > a warning. Annoying. >=20 > And: >=20 > if( expr1 && expr2 || expr3 && expr4 ) > ... >=20 > Also gives a warning. >=20 >=20 > Perhaps the compiler developers fear they may have made some mistake and > ask the programmers to add parenthesis to avoid exposing a bug in the > compiler? >=20 >=20 > Isaac >=20 Isn't that just what warnings are for? It compiles OK but it might not be w= hat=20 you wanted. Just like: if (A=3DB){ ... I have learned that the clearer code I write the more easy it is to maintai= n in=20 the long run. It might take you a week to write the initial code but it mig= ht=20 need to be maintained for another 10 years (updates, changes - not bugfixin= g).=20 And the one maintaining it might not be the one who wrote it in the first=20 place. I generally sprinkle paranthesis and curly braces all over the code to make= it=20 very clear what I wanted (besides I never remember precedence anyway so I t= ry=20 not to rely on it). I also try not to use too elaborate one-line C-code.=20 Instead I split the code in several steps and let the compiler optimize it = for=20 me. Besides it is also often more easy to debug. If I was handed code like the above, I would have to go through the rest of= the=20 code in more detail to be sure that it is what is written that is actually = what=20 is intended. Especially if it is some sort of error handling that normally = is=20 never executed and might never have been tested. All this can take a lot of= =20 time. Of course you can comment the code but I have seen a lot of code (my = own=20 included) that has an original set of comments and then something in the co= de=20 was changed but the comments have never been updated, which is almost worse= =20 than no comments at all. Bottom line is that the clearer and simpler the code is the easier it is to= =20 come back to it sometime in the future, which almost always happens. /Ruben =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D Ruben J=F6nsson AB Liros Electronic Box 9124, 200 39 Malm=F6, Sweden TEL INT +46 40142078 FAX INT +46 40947388 ruben@pp.sbbs.se =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .