AutosarC++18_10-M27.0.1¶
The stream input/output library <cstdio> shall not be used
Required inputs: IR
| Level | required |
|---|---|
| Target | implementation |
| Enforcement | automated |
Rationale
This includes file and I/O functions fgetpos, fopen, ftell, gets, perror, remove, rename, etc.
Streams and file I/O have a large number of unspecified, undefined and implementation-defined behaviours associated with them.
Example
#include <cstdio> // Non-compliant
void fn ( )
{
char_t array [ 10 ];
gets ( array ); // Can lead to buffer over-run
}
Note
For legal reasons, this rule’s description is not part of the public documentation.