Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 20.9
#1
Rule 20.9 says that the input/output library shall not be used in production code.

We can not use the function open because is not ANSI C. Which would be the alternative to open a file instead of fopen?

Thanks.
#2
You must avoid undefined behaviour, you must not rely on unspecified behaviour, and you must document implementation defined behaviour.

Many library functions contain instances of such behaviour. Where possible, additional measures should be used to avoid the risk of reliance on such behaviour. Deviations should document such use.

fopen() could be used with an appropriate deviation to rule 20.9.
open() could be used with an appropriate deviation to rule 3.6.
Posted by and on behalf of the MISRA C Working Group


Forum Jump:


Users browsing this thread: 1 Guest(s)