The macro EOF shall only be compared with the unmodified return value from any Standard Library function capable of returning EOF
The macro EOF shall only be compared with the
unmodified return value from any Standard Library function capable of returning
EOF.
This rule comes from MISRA C®: 2012 Amendment 1.
The EOF value may become indistinguishable from a valid
character code if the value returned is converted to another type. In such cases,
testing the converted value against EOF will not reliably
identify if the end of the file has been reached or if an error has occurred.
If you expect a rule violation but do not see it, refer to the documentation of Polyspace® Bug Finder™ or Polyspace Bug Finder Server™.
| Group: Resources |
| Category: Required |
| AGC Category: Required |