Rule 20.9

6.20 Standard Libraries

Moderators: misra-c, david ward

Locked
Nuria
Posts: 1
Joined: Mon Feb 20, 2006 5:02 pm

Rule 20.9

Post by Nuria » Tue Feb 21, 2006 10:56 am

Rule 20.9 says that the input/output library <stdio.h> 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.

misra-c
Posts: 566
Joined: Thu Jan 05, 2006 1:11 pm

Post by misra-c » Thu Apr 27, 2006 2:29 pm

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

Locked

Return to “6.20 Standard Libraries”