MISRAC++2008-19-3-1
In this section:
Synopsis
(Required) The error indicator errno shall not be used.
Enabled by default
Yes
Severity/Certainty
Low/Medium

Full description
Uses of errno were found. This check is identical to MISRAC2004-20.5.
Coding standards
- MISRA C:2004 20.5
(Required) The error indicator errno shall not be used.
Code examples
The following code example fails the check and will give a warning:
#include <errno.h>
#include <stdlib.h>
int example(char buf[]) {
int i;
errno = 0;
i = atoi(buf);
return (errno == 0) ? i : 0;
}
The following code example passes the check and will not give a warning about this issue:
void example(void) {
}