TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
TIOBE - C Coding Standard
Search

SR:  9.2#1Checked automatically with code checker

Synopsis:A statement must have a side-effect, i.e., it must do something.
Language:C
Severity Level:1
Category:STATEMENTS


Description:
An uncomfortably frequent problem in C is to use == as an assignment. The compiler does a comparison, returns 1 or 0 and then discards the result silently.

Example:

i; /* WRONG - but legal ! */
i++; /* RIGHT - does something */