Path: utzoo!mnetor!uunet!husc6!rutgers!clyde!watmath!rbutterworth From: rbutterworth@watmath.waterloo.edu (Ray Butterworth) Newsgroups: comp.lang.c Subject: A lint solution for == and =. Message-ID: <16427@watmath.waterloo.edu> Date: 21 Jan 88 19:28:12 GMT References: <11220@brl-adm.ARPA> <3975@uw-june.UUCP> Organization: U of Waterloo, Ontario Lines: 35 For those that care, here's a modified section of the 4.3 BSD first pass of lint: contx(p, down, pl, pr) register NODE *p; register *pl, *pr; { *pl = *pr = VAL; if (p->in.type==UNDEF) /* (void) cast */ down=VAL; switch( p->in.op ){ case NOT: *pl = down; /*FALLTHROUGH*/ case ANDAND: case OROR: if (hflag && (p->in.right->in.op==ASSIGN)) werror("Possible unintended assignment"); ;/*FALLTHROUGH*/ case QUEST: *pr = down; /*FALLTHROUGH*/ case CBRANCH: if (hflag && (p->in.left->in.op==ASSIGN)) werror("possible unintended assignment"); break; case SCONV: case PCONV: ...