Using this example:- if(iBlock_Size =3D 0) { return 0; } gives this:-=20 Warning [758] C:\Source\UI_Test\dongle.c; 107. constant conditional branch:= possible use of "=3D" instead of "=3D=3D"=20 BUT still builds ok..=20 obviously the syntax should be if(iBlock_Size =3D=3D 0) { return 0; } but my colleague uses=20 if(0 =3D=3D iBlock_Size) { return 0; } Which although syntactically correct, just doesn't feel right. He uses it for ALL ifs so=20 if(127 < iBlock_Size) { return 0; } Which is counter intuitive in my mind. Perhaps I am just getting old? They should ALL produce an error with=20 if(0 =3D iBlock_Size) { return 0; } as you cannot assign to the 0 on the left side Error [202] C:\Source\UI_Test\dongle.c; 107.19 only lvalues may be assign= ed to or modified On Mon 12/03/12 10:18 AM , Tamas Rudnai tamas.rudnai@gmail.com sent: > On 12 March 2012 09:20, Chris Roper caroper@gma > il.com> wrote: > > I agree with your colleague. > > I use several compilers and several "C Type" > languages, not all of them> will give a warning but all will generate the > error.> >=20 > You mean if you write: >=20 > if ( 0 =3D x ) ... >=20 > then not all C compiler will generate an error? >=20 > Tamas >=20 >=20 >=20 >=20 > > > > On 12 March 2012 10:03, Jim jimf@we > bstudios.co.uk> wrote:> > > > I have a colleague who insists on using this > reverse syntax> > > > > if(0 =3D=3D x) { > > > ...do stuff > > > } > > > > > > which I find odd to read at the best of > times...> > > > > We're using embedded C, (Hitech), and > whilst> > if(x =3D0) doesn't throw an error, it does throw > a warning.> > > > > oh well. > > > > > > -Jim > > > > > > > > > > > > > > > > > > > > > > Isn't that just what warnings are for? It > compiles OK but it might not> be > > > > what you wanted. Just like: > > > > > > > > if (A=3DB){ > > > > ... > > > > > > > > > > > > > > > > > > > -- > > > http://www.piclist.com PIC/SX FAQ & list > archive> > View/change your membership options at > > > http://mailman.mit.edu/mailman/listinfo/piclist> > > > -- > > http://www.piclist.com PIC/SX FAQ & list > archive> View/change your membership options at > > http://mailman.mit.edu/mailman/listinfo/piclist> >=20 >=20 >=20 > --=20 > int main() { char *a,*s,*q; printf(s=3D"int main() { char *a,*s,*q; > printf(s=3D%s%s%s, q=3D%s%s%s%s,s,q,q,a=3D%s%s%s%s,q,q,q,a,a,q); }", > q=3D"\"",s,q,q,a=3D"\\",q,q,q,a,a,q); } > --=20 > http://www.piclist.com PIC/SX FAQ & list archiveView/change your membersh= ip options at > http://mailman.mit.edu/mailman/listinfo/piclist >=20 >=20 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .