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 */ |