...
Using an expression that has side effects as the stream argument to getc(), putc(), or getwc() can result in unexpected behavior and abnormal program termination.
Rule | Severity | Likelihood | Detectable | RepairableRemediation Cost | Priority | Level |
|---|---|---|---|---|---|---|
FIO41-C | Low | Unlikely | Yes | YesMedium | P2P3 | L3 |
Automated Detection
Tool | Version | Checker | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Astrée |
| stream-argument-with-side-effects | Fully checked | ||||||
| Axivion Bauhaus Suite |
| CertC-FIO41 | |||||||
| Cppcheck Premium |
| premium-cert-fio41-c | |||||||
| Helix QAC |
| C5036 C++3225, C++3229 | |||||||
| LDRA tool suite |
| 35 D, 1 Q, 9 S, | Fully implemented | ||||||
| Parasoft C/C++test |
| CERT_C-FIO41-a | Do not call 'getc()', 'putc()', 'getwc()', or 'putwc()' with a stream argument containing assignments, increment or decrement operators Do not call 'getc()', 'putc()', 'getwc()', or 'putwc()' with a stream argument containing function calls or function-like macro calls | ||||||
| CERT C: Rule FIO41-C | Checks for stream arguments with possibly unintended side effects (rule fully covered) | |||||||
| RuleChecker |
| stream-argument-with-side-effects | Fully checked |
...